Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
57
cde/programs/dtmail/include/DtMail/AliasListUiItem.hh
Normal file
57
cde/programs/dtmail/include/DtMail/AliasListUiItem.hh
Normal file
@@ -0,0 +1,57 @@
|
||||
/* $XConsortium: AliasListUiItem.hh /main/4 1996/04/21 19:44:13 drk $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifndef _ALIASLISTUIITEM_HH
|
||||
#define _ALIASLISTUIITEM_HH
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
extern void handleDoubleSelection(Widget w, XtPointer clientdata, XtPointer calldata);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
// CLASS AliasListUiItem
|
||||
// derived class for prop sheet glue items for textfield
|
||||
///////////////////////////////////////////////////////////
|
||||
class AliasListUiItem : public ListUiItem {
|
||||
|
||||
public:
|
||||
AliasListUiItem(Widget w, int source, char *search_key, Widget w_k, Widget w_v);
|
||||
virtual ~AliasListUiItem(){;}; // we don't alloc any memory
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
Widget getKeyWidget(){ return key_widget;};
|
||||
Widget getValueWidget(){ return value_widget;};
|
||||
DtVirtArray<PropStringPair *> *getItemList(){ return list_items; };
|
||||
|
||||
virtual void handleAddButtonPress();
|
||||
virtual void handleChangeButtonPress();
|
||||
virtual void handleDeleteButtonPress();
|
||||
|
||||
private:
|
||||
|
||||
DtVirtArray<PropStringPair *> *list_items;
|
||||
DtVirtArray<char *> *deleted_items;
|
||||
|
||||
Widget key_widget;
|
||||
Widget value_widget;
|
||||
};
|
||||
|
||||
#endif
|
||||
50
cde/programs/dtmail/include/DtMail/AlternatesListUiItem.hh
Normal file
50
cde/programs/dtmail/include/DtMail/AlternatesListUiItem.hh
Normal file
@@ -0,0 +1,50 @@
|
||||
/* $XConsortium: AlternatesListUiItem.hh /main/3 1996/04/21 19:44:17 drk $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifndef _ALTERNATESLISTUIITEM_HH
|
||||
#define _ALTERNATESLISTUIITEM_HH
|
||||
|
||||
// CLASS AlternatesListUiItem
|
||||
// derived class for prop sheet glue items for textfield
|
||||
///////////////////////////////////////////////////////////
|
||||
class AlternatesListUiItem : public ListUiItem {
|
||||
|
||||
public:
|
||||
AlternatesListUiItem(Widget w, int source, char *search_key, Widget w_list);
|
||||
virtual ~AlternatesListUiItem(){;}; // we don't alloc any memory
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
Widget getEntryFieldWidget(){ return entry_field_widget;};
|
||||
DtVirtArray<PropStringPair *> *getItemList(){ return list_items; };
|
||||
|
||||
virtual void handleAddButtonPress();
|
||||
virtual void handleChangeButtonPress();
|
||||
virtual void handleDeleteButtonPress();
|
||||
|
||||
private:
|
||||
|
||||
DtVirtArray<PropStringPair *> *list_items;
|
||||
DtVirtArray<char *> *deleted_items;
|
||||
Widget entry_field_widget;
|
||||
};
|
||||
|
||||
#endif
|
||||
50
cde/programs/dtmail/include/DtMail/AntiCheckBoxUiItem.hh
Normal file
50
cde/programs/dtmail/include/DtMail/AntiCheckBoxUiItem.hh
Normal file
@@ -0,0 +1,50 @@
|
||||
/* $XConsortium: AntiCheckBoxUiItem.hh /main/4 1996/04/21 19:44:20 drk $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include "CheckBoxUiItem.hh"
|
||||
|
||||
#ifndef _ANTICHECKBOXUIITEM_HH
|
||||
#define _ANTICHECKBOXUIITEM_HH
|
||||
|
||||
// CLASS AntiCheckBoxUiItem
|
||||
// derived class for prop sheet glue items for CheckBox
|
||||
///////////////////////////////////////////////////////////
|
||||
class AntiCheckBoxUiItem : public CheckBoxUiItem {
|
||||
|
||||
public:
|
||||
AntiCheckBoxUiItem(Widget w, int source, char *search_key);
|
||||
virtual ~AntiCheckBoxUiItem(){;}; // we don't alloc any memory
|
||||
#ifdef DEAD_WOOD
|
||||
virtual int getType(){ return _ANTICHECKBOX_ITEM; };
|
||||
virtual int getSource(){ return data_source; };
|
||||
#endif /* DEAD_WOOD */
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
|
||||
private:
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
int data_source;
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
163
cde/programs/dtmail/include/DtMail/Buffer.hh
Normal file
163
cde/programs/dtmail/include/DtMail/Buffer.hh
Normal file
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $XConsortium: Buffer.hh /main/4 1996/04/21 19:44:23 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTMAILBUFFER_HH
|
||||
#define _DTMAILBUFFER_HH
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
// these classes are provided in order to have a logical array whose
|
||||
// size is not known at creation time. The DtMailBuffer class
|
||||
// holds the data, and for the moment holds the only "write" operation
|
||||
// (which is append). In addition, to be thread safe, there is
|
||||
// a separate class for reading, so that you can have separate
|
||||
// "seek points" in the read buffer in different procedures.
|
||||
|
||||
class BufReader;
|
||||
|
||||
class Buffer {
|
||||
|
||||
|
||||
protected:
|
||||
static const int defaultchunksize;
|
||||
|
||||
public:
|
||||
|
||||
Buffer();
|
||||
|
||||
// actually add data. result is # of bytes written. Can
|
||||
// fail if underlying write fails, or if out of memory.
|
||||
virtual int appendData(const char *user_buffer, int length) = 0;
|
||||
|
||||
// an interator function that gets called so that eventually
|
||||
// the entire buffer has been passed through
|
||||
typedef unsigned long (*CallBack)(const char *buffer, int len, va_list);
|
||||
virtual unsigned long iterate(CallBack, ...) = 0;
|
||||
|
||||
// get a new reader object
|
||||
virtual BufReader *getReader(void) = 0;
|
||||
|
||||
virtual int getSize(void) = 0; // get total size of the buffer
|
||||
|
||||
|
||||
protected:
|
||||
virtual ~Buffer(void);
|
||||
private:
|
||||
Buffer(const Buffer&); // try and avoid copies
|
||||
|
||||
|
||||
};
|
||||
|
||||
// subsidiary classes
|
||||
class BufReader {
|
||||
public:
|
||||
// actually read data into a user specified buffer
|
||||
virtual int getData(char *user_buffer, int length) = 0;
|
||||
virtual ~BufReader(void);
|
||||
|
||||
protected:
|
||||
BufReader();
|
||||
private:
|
||||
BufReader(const BufReader &);
|
||||
};
|
||||
|
||||
|
||||
class BufReaderMemory;
|
||||
class BufferMemory : public Buffer {
|
||||
|
||||
public:
|
||||
class Chunk;
|
||||
friend class BufReaderMemory;
|
||||
|
||||
BufferMemory(int chunksize);
|
||||
BufferMemory();
|
||||
virtual ~BufferMemory(void);
|
||||
|
||||
// actually add data. result is # of bytes written. Can
|
||||
// fail if underlying write fails, or if out of memory.
|
||||
virtual int appendData(const char *user_buffer, int length);
|
||||
|
||||
virtual unsigned long iterate(Buffer::CallBack, ...);
|
||||
|
||||
// get a new reader object
|
||||
virtual BufReader *getReader(void);
|
||||
|
||||
virtual int getSize(void); // get total size of the buffer
|
||||
|
||||
private:
|
||||
class Chunk;
|
||||
|
||||
BufferMemory(const Buffer&); // try and avoid copies
|
||||
void initBuffer(int size); // common constructor
|
||||
int newChunk(int size); // get a new data chunk
|
||||
|
||||
Chunk *_firstchunk; // first chunk
|
||||
Chunk *_lastchunk; // last chunk
|
||||
int _totalsize; // total size in all buffers
|
||||
int _chunksize; // size to allocate new buffers
|
||||
|
||||
void *_mutex;
|
||||
|
||||
BufReaderMemory *_firstreader; // linked list of readers
|
||||
|
||||
|
||||
public:
|
||||
// aux structure to hold data; no active functions
|
||||
struct Chunk {
|
||||
struct Chunk *_nextchunk; // next element in linked list
|
||||
char *_buffer; // data buffer
|
||||
int _chunksize; // allocated size of buffer
|
||||
int _currentend; // current used space
|
||||
};
|
||||
|
||||
// subsidiary classes
|
||||
};
|
||||
|
||||
class BufReaderMemory : protected BufReader {
|
||||
friend class BufferMemory;
|
||||
|
||||
public:
|
||||
// actually read data into a user specified buffer
|
||||
virtual int getData(char *user_buffer, int length);
|
||||
virtual ~BufReaderMemory(void);
|
||||
|
||||
private:
|
||||
BufReaderMemory(const BufReaderMemory &);
|
||||
BufReaderMemory(BufferMemory *);
|
||||
|
||||
BufferMemory::Chunk *_currentchunk;
|
||||
int _currentoffset;
|
||||
|
||||
BufferMemory *_buffer;
|
||||
BufReaderMemory *_nextreader; // maintain linked list of readers
|
||||
BufReaderMemory *_prevreader; // maintain linked list of readers
|
||||
};
|
||||
|
||||
#endif // _DTMAILBUFFER_HH
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
49
cde/programs/dtmail/include/DtMail/CheckBoxUiItem.hh
Normal file
49
cde/programs/dtmail/include/DtMail/CheckBoxUiItem.hh
Normal file
@@ -0,0 +1,49 @@
|
||||
/* $TOG: CheckBoxUiItem.hh /main/5 1997/11/07 15:44:05 mgreess $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _CHECKBOXUIITEM_HH
|
||||
#define _CHECKBOXUIITEM_HH
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#include <DtMail/PropUi.hh>
|
||||
|
||||
// CLASS CheckBoxUiItem
|
||||
// derived class for prop sheet glue items for CheckBox
|
||||
///////////////////////////////////////////////////////////
|
||||
class CheckBoxUiItem : public PropUiItem {
|
||||
|
||||
public:
|
||||
CheckBoxUiItem(Widget w, int source, char *search_key);
|
||||
virtual ~CheckBoxUiItem(){;}; // we don't alloc any memory
|
||||
#ifdef DEAD_WOOD
|
||||
virtual int getType(){ return _CHECKBOX_ITEM; };
|
||||
virtual int getSource(){ return data_source; };
|
||||
#endif /* DEAD_WOOD */
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
|
||||
private:
|
||||
#ifdef DEAD_WOOD
|
||||
int data_source;
|
||||
#endif /* DEAD_WOOD */
|
||||
};
|
||||
|
||||
#endif
|
||||
49
cde/programs/dtmail/include/DtMail/CheckForMailUiItem.hh
Normal file
49
cde/programs/dtmail/include/DtMail/CheckForMailUiItem.hh
Normal file
@@ -0,0 +1,49 @@
|
||||
/* $TOG: CheckForMailUiItem.hh /main/1 1998/02/17 15:19:39 mgreess $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#include <DtMail/SpinBoxUiItem.hh>
|
||||
|
||||
#ifndef _CHECKFORMAILUIITEM_HH
|
||||
#define _CHECKFORMAILUIITEM_HH
|
||||
|
||||
// CLASS CheckForMailUiItem
|
||||
// derived class for prop sheet glue items for SpinBox
|
||||
///////////////////////////////////////////////////////////
|
||||
class CheckForMailUiItem : public SpinBoxUiItem {
|
||||
|
||||
public:
|
||||
static DtVirtArray<CheckForMailUiItem *> *_checkformail_ui;
|
||||
static int _initialized;
|
||||
int _valueChanged;
|
||||
|
||||
CheckForMailUiItem(Widget w, int source, char *search_key);
|
||||
virtual ~CheckForMailUiItem(){;}; // we don't alloc any memory
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
static void valueChangedCB(Widget, XtPointer, XtPointer);
|
||||
|
||||
private:
|
||||
DtVirtArray<PropUiItem*> *_linked_pui;
|
||||
};
|
||||
|
||||
#endif
|
||||
38
cde/programs/dtmail/include/DtMail/Common.h
Normal file
38
cde/programs/dtmail/include/DtMail/Common.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: Common.h /main/4 1996/04/21 19:44:30 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _COMMON_H
|
||||
#define _COMMON_H
|
||||
|
||||
#include <unistd.h>
|
||||
#include <nl_types.h>
|
||||
|
||||
// XPG3 compatible. NL_CAT_LOCALE is set to non-zero in XPG4. Use NL_CAT_LOCALE
|
||||
// for all catopen() calls.
|
||||
#if defined(sun) && (_XOPEN_VERSION == 3)
|
||||
#undef NL_CAT_LOCALE
|
||||
#define NL_CAT_LOCALE 0
|
||||
|
||||
// If NL_CAT_LOCALE is not defined in other platforms, set it to 0
|
||||
#elif !defined(NL_CAT_LOCALE)
|
||||
#define NL_CAT_LOCALE 0
|
||||
#endif
|
||||
|
||||
#endif // _COMMON_H
|
||||
56
cde/programs/dtmail/include/DtMail/CustomListUiItem.hh
Normal file
56
cde/programs/dtmail/include/DtMail/CustomListUiItem.hh
Normal file
@@ -0,0 +1,56 @@
|
||||
/* $XConsortium: CustomListUiItem.hh /main/4 1996/04/21 19:44:33 drk $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifndef _CUSTOMLISTUIITEM_HH
|
||||
#define _CUSTOMLISTUIITEM_HH
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
void handleDoubleSelection(Widget w, XtPointer clientdata, XtPointer calldata);
|
||||
#endif /* DEAD_WOOD */
|
||||
// CLASS CustomListUiItem
|
||||
// derived class for prop sheet glue items for textfield
|
||||
///////////////////////////////////////////////////////////
|
||||
class CustomListUiItem : public ListUiItem {
|
||||
|
||||
public:
|
||||
CustomListUiItem(Widget w, int source, char *search_key, Widget w_k, Widget w_v);
|
||||
virtual ~CustomListUiItem(){;}; // we don't alloc any memory
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
Widget getKeyWidget(){ return key_widget;};
|
||||
Widget getValueWidget(){ return value_widget;};
|
||||
DtVirtArray<PropStringPair *> *getItemList(){ return list_items; };
|
||||
|
||||
virtual void handleAddButtonPress();
|
||||
virtual void handleChangeButtonPress();
|
||||
virtual void handleDeleteButtonPress();
|
||||
|
||||
private:
|
||||
|
||||
DtVirtArray<PropStringPair *> *list_items;
|
||||
DtVirtArray<char *> *deleted_items;
|
||||
|
||||
Widget key_widget;
|
||||
Widget value_widget;
|
||||
};
|
||||
|
||||
#endif
|
||||
75
cde/programs/dtmail/include/DtMail/Dictionary.hh
Normal file
75
cde/programs/dtmail/include/DtMail/Dictionary.hh
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $XConsortium: Dictionary.hh /main/4 1996/04/21 19:44:36 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTM_DICTIONARY_HH
|
||||
#define _DTM_DICTIONARY_HH
|
||||
|
||||
#include "DtVirtArray.hh"
|
||||
|
||||
class DtMailDictionaryImpl : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
// The hash_size must be <= 256. Setting to smaller sizes
|
||||
// will reduce the memory used by the dictionary, but may increase
|
||||
// the hash collisions resulting in slower performance.
|
||||
//
|
||||
DtMailDictionaryImpl(int hash_size = 256);
|
||||
~DtMailDictionaryImpl(void);
|
||||
|
||||
void set(const char * key, const void * value);
|
||||
const void * lookup(const char * key);
|
||||
void remove(const char * key);
|
||||
|
||||
private:
|
||||
struct Entry : public DtCPlusPlusAllocator {
|
||||
char * key;
|
||||
const void * value;
|
||||
};
|
||||
|
||||
typedef DtVirtArray<Entry *> * HashTable_t;
|
||||
|
||||
HashTable_t *_hash_table;
|
||||
int _hash_size;
|
||||
void *_obj_mutex;
|
||||
|
||||
int hashValue(const char * key);
|
||||
void locate(int hash_value, const char * key, Entry ** entry);
|
||||
};
|
||||
|
||||
template <class Element>
|
||||
class DtMailDictionary : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
DtMailDictionary(int hash_size = 256) : _dict(hash_size) { }
|
||||
~DtMailDictionary(void) { }
|
||||
|
||||
void set(const char * key, const Element value) { _dict.set(key, value); }
|
||||
|
||||
const Element lookup(const char * key) {
|
||||
return((const Element)_dict.lookup(key));
|
||||
}
|
||||
|
||||
void remove(const char * key) { _dict.remove(key); }
|
||||
|
||||
private:
|
||||
DtMailDictionaryImpl _dict;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
37
cde/programs/dtmail/include/DtMail/DtLanguages.hh
Normal file
37
cde/programs/dtmail/include/DtMail/DtLanguages.hh
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $XConsortium: DtLanguages.hh /main/4 1996/04/21 19:44:39 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTLANGUAGES_HH
|
||||
#define _DTLANGUAGES_HH
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
// The DtCPlusPlusAllocator class is provided to allow C applications
|
||||
// to access the C++ implementation. C applications will not typically
|
||||
// have access to new and delete so they are over ridden here.
|
||||
//
|
||||
class DtCPlusPlusAllocator {
|
||||
public:
|
||||
static void * operator new(size_t size);
|
||||
static void operator delete(void * ptr);
|
||||
};
|
||||
|
||||
#endif
|
||||
278
cde/programs/dtmail/include/DtMail/DtMail.h
Normal file
278
cde/programs/dtmail/include/DtMail/DtMail.h
Normal file
@@ -0,0 +1,278 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $XConsortium: DtMail.h /main/4 1996/04/21 19:44:43 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTMAIL_H
|
||||
#define _DTMAIL_H
|
||||
|
||||
#include <Tt/tttk.h>
|
||||
#include "DtMailTypes.h"
|
||||
#include "DtMailProps.h"
|
||||
#include "DtMailError.hh"
|
||||
#include "DtMailValues.hh"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
/* Mail Session and Administration API */
|
||||
/* API spec sections 3.2.1 - 3.2.8 */
|
||||
|
||||
extern DtMailSession DtMailCreateSession(DtMailEnv *,
|
||||
const char *);
|
||||
|
||||
extern void DtMailCloseSession(DtMailEnv *,
|
||||
DtMailSession,
|
||||
DtMailBoolean);
|
||||
|
||||
extern int DtMailGetMinorCode(DtMailEnv *);
|
||||
|
||||
extern const char * DtMailGetErrorString(DtMailEnv *);
|
||||
|
||||
extern const char ** DtMailEnumerateImpls(DtMailSession,
|
||||
DtMailEnv *);
|
||||
extern void DtMailSetDefaultImpl(DtMailSession,
|
||||
DtMailEnv *,
|
||||
const char *);
|
||||
extern const char * DtMailGetDefaultImpl(DtMailSession,
|
||||
DtMailEnv *);
|
||||
extern void DtMailQueryImpl(DtMailSession,
|
||||
DtMailEnv *,
|
||||
const char *,
|
||||
const char *,
|
||||
...);
|
||||
|
||||
|
||||
/* MailBox methods. */
|
||||
/* API spec sections 3.2.9 - 3.2.20 */
|
||||
|
||||
extern DtMailMailBox DtMailMailBoxConstruct(DtMailSession,
|
||||
DtMailEnv *,
|
||||
DtMailObjectSpace,
|
||||
void *,
|
||||
DtMailCallback,
|
||||
void *);
|
||||
|
||||
extern void DtMailMailBoxDestruct(DtMailMailBox);
|
||||
|
||||
extern void DtMailMailBoxCreate(DtMailMailBox,
|
||||
DtMailEnv *);
|
||||
|
||||
extern void DtMailMailBoxOpen(DtMailMailBox,
|
||||
DtMailEnv *,
|
||||
DtMailBoolean);
|
||||
|
||||
extern DtMailMessageHandle DtMailMailBoxGetFirstMessageSummary (DtMailMailBox,
|
||||
DtMailEnv *,
|
||||
const DtMailHeaderRequest *,
|
||||
DtMailHeaderLine **);
|
||||
|
||||
extern DtMailMessageHandle DtMailMailBoxGetNextMessageSummary (DtMailMailBox,
|
||||
DtMailEnv *,
|
||||
DtMailMessageHandle,
|
||||
const DtMailHeaderRequest *,
|
||||
DtMailHeaderLine **);
|
||||
|
||||
extern DtMailMessage DtMailMailBoxGetMessage(DtMailMailBox,
|
||||
DtMailEnv *
|
||||
DtMailMessageHandle);
|
||||
|
||||
extern DtMailMessage DtMailMailBoxGetFirstMessage(DtMailMailBox,
|
||||
DtMailEnv *);
|
||||
|
||||
extern DtMailMessage DtMailMailBoxGetNextMessage(DtMailMailBox,
|
||||
DtMailEnv *,
|
||||
DtMailMessage);
|
||||
|
||||
extern DtMailMessage DtMailMailBoxNewMessage(DtMailMailBox,
|
||||
DtMailEnv *);
|
||||
|
||||
extern const char * DtMailMailBoxImpl(DtMailMailBox,
|
||||
DtMailEnv *);
|
||||
|
||||
/* Header API Methods */
|
||||
/* API spec sections 3.2.21 - 3.2.23 */
|
||||
|
||||
extern DtMailHeaderRequest * DtMailHeaderRequestCreate(DtMailEnv *,
|
||||
const int);
|
||||
|
||||
extern void DtMailHeaderRequestDestroy(DtMailHeaderRequest *,
|
||||
DtMailEnv *);
|
||||
|
||||
extern void DtMailHeaderLineDestroy (DtMailHeaderLine *,
|
||||
DtMailEnv *);
|
||||
|
||||
|
||||
/* Message methods. */
|
||||
/* API spec sections 3.2.24 - 3.2.35 */
|
||||
|
||||
extern DtMailMessage DtMailMessageConstruct(DtMailEnv *,
|
||||
DtMailSession,
|
||||
const char *,
|
||||
DtMailCallback,
|
||||
void *);
|
||||
|
||||
extern void DtMailMessageCreate(DtMailMessage,
|
||||
DtMailEnv *);
|
||||
|
||||
extern void DtMailMessageOpen(DtMailMessage,
|
||||
DtMailEnv *
|
||||
DtMailBoolean);
|
||||
|
||||
extern void DtMailMessageDestruct(DtMailMessage);
|
||||
|
||||
extern DtMailEnvelope DtMailMessageGetEnvelope(DtMailMessage,
|
||||
DtMailEnv *);
|
||||
|
||||
extern int DtMailMessageGetBodyCount(DtMailMessage,
|
||||
DtMailEnv *);
|
||||
|
||||
extern DtMailBodyPart DtMailMessageGetFirstBodyPart(DtMailMessage,
|
||||
DtMailEnv *);
|
||||
|
||||
extern DtMailBodyPart DtMailMessageGetNextBodyPart(DtMailMessage,
|
||||
DtMailEnv *,
|
||||
DtMailBodyPart);
|
||||
|
||||
extern DtMailBodyPart DtMailMessageNewBodyPart(DtMailMessage,
|
||||
DtMailEnv *,
|
||||
DtMailBodyPart);
|
||||
|
||||
extern void DtMailMessageNewBodyPartOrder (DtMailMessage,
|
||||
DtMailEnv *,
|
||||
DtMailBodyPart *,
|
||||
int);
|
||||
|
||||
// TOGO extern CMContainer DtMailMessageContainer(DtMailMessage,
|
||||
// TOGO DtMailEnv *);
|
||||
|
||||
extern const char * DtMailMessageImpl(DtMailMessage,
|
||||
DtMailEnv *);
|
||||
|
||||
/* Envelope Methods */
|
||||
/* API spec sections 3.2.36 - 3.2.41 */
|
||||
|
||||
extern DtMailHeaderHandle DtMailEnvelopeGetFirstHeader(DtMailEnvelope,
|
||||
DtMailEnv *,
|
||||
char **,
|
||||
DtMailValueSeq *);
|
||||
|
||||
extern DtMailHeaderHandle DtMailEnvelopeGetNextHeader(DtMailEnvelope,
|
||||
DtMailEnv *,
|
||||
DtMailHeaderHandle,
|
||||
char **,
|
||||
DtMailValueSeq *);
|
||||
|
||||
extern void DtMailEnvelopeGetHeader(DtMailEnvelope,
|
||||
DtMailEnv *,
|
||||
const char *,
|
||||
const DtMailBoolean,
|
||||
DtMailValueSeq *);
|
||||
|
||||
extern void DtMailEnvelopeSetHeaderSeq(DtMailEnvelope,
|
||||
DtMailEnv *,
|
||||
const char *,
|
||||
const DtMailValueSeq *);
|
||||
|
||||
extern void DtMailEnvelopeSetHeader(DtMailEnvelope,
|
||||
DtMailEnv *,
|
||||
const char *,
|
||||
const DtMailValueSeq *,
|
||||
DtMailBoolean);
|
||||
|
||||
extern void DtMailEnvelopeDestruct(DtMailEnvelope);
|
||||
|
||||
|
||||
/* BodyPart methods. */
|
||||
/* API spec sections 3.2.42 - 3.2.49 */
|
||||
|
||||
extern DtMailHeaderHandle DtMailBodyPartGetFirstHeader(DtMailBodyPart,
|
||||
DtMailEnv *,
|
||||
char **,
|
||||
DtMailValueSeq **);
|
||||
|
||||
extern DtMailHeaderHandle DtMailBodyPartGetNextHeader(DtMailBodyPart,
|
||||
DtMailEnv *,
|
||||
DtMailHeaderHandle,
|
||||
char **,
|
||||
DtMailValueSeq **);
|
||||
|
||||
extern void DtMailBodyPartGetHeader(DtMailBodyPart,
|
||||
DtMailEnv *,
|
||||
const char *,
|
||||
const DtMailBoolean,
|
||||
DtMailValueSeq *);
|
||||
|
||||
extern void DtMailBodyPartSetHeaderSeq(DtMailBodyPart,
|
||||
DtMailEnv *,
|
||||
const char *,
|
||||
const DtMailValueSeq *);
|
||||
|
||||
extern void DtMailBodyPartSetHeader(DtMailBodyPart,
|
||||
DtMailEnv *,
|
||||
const DtMailValueSeq *,
|
||||
DtMailBoolean);
|
||||
|
||||
extern void DtMailBodyPartGetContents(DtMailBodyPart,
|
||||
DtMailEnv *,
|
||||
void **,
|
||||
unsigned long *,
|
||||
char **,
|
||||
char **,
|
||||
int *,
|
||||
char *);
|
||||
|
||||
extern void DtMailBodyPartSetContents(DtMailBodyPart,
|
||||
DtMailEnv *,
|
||||
const void *,
|
||||
const unsigned long,
|
||||
const char *,
|
||||
const char *,
|
||||
const int,
|
||||
const char *);
|
||||
|
||||
extern void DtMailBodyPartDestruct(DtMailBodyPart);
|
||||
|
||||
|
||||
/* Transport Methods. */
|
||||
/* API spec sections 3.2.57 - 3.2.59 */
|
||||
|
||||
extern DtMailTransport DtMailTranportConstruct(DtMailSession,
|
||||
DtMailEnv *,
|
||||
const char *);
|
||||
|
||||
extern const char ** DtMailTransportEnumerate(DtMailSession,
|
||||
DtMailEnv *);
|
||||
|
||||
extern DtMailTransportSubmit(DtMailTransport,
|
||||
DtMailEnv *,
|
||||
DtMailMessage);
|
||||
|
||||
#else /* __STDC__ */
|
||||
|
||||
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
914
cde/programs/dtmail/include/DtMail/DtMail.hh
Normal file
914
cde/programs/dtmail/include/DtMail/DtMail.hh
Normal file
@@ -0,0 +1,914 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $TOG: DtMail.hh /main/18 1998/11/10 17:02:07 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#ifndef _DTMAIL_HH
|
||||
#define _DTMAIL_HH
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/stat.h>
|
||||
/*#include <nl_types.h>*/
|
||||
#include <DtMail/DtMailError.hh>
|
||||
#include <DtMail/DtMailProps.h>
|
||||
#include <DtMail/DtMailTypes.h>
|
||||
#include <DtMail/DtVirtArray.hh>
|
||||
#include <DtMail/DtLanguages.hh>
|
||||
#include <Tt/tttk.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
// Define a type for the handler used in RFCTransport::launchSendmail
|
||||
typedef void SubProcessFinishedProc (int pid, int status, void *data);
|
||||
|
||||
//
|
||||
// Gorp to get mailrc to work
|
||||
//
|
||||
#define HSHSIZE 40
|
||||
#define MAILRC_NOFILE 20 /* this define is here for */
|
||||
/* compatibility purposes only */
|
||||
/* and will be removed in a */
|
||||
/* later release */
|
||||
|
||||
#ifdef __osf__
|
||||
struct hash;
|
||||
struct var;
|
||||
#endif
|
||||
|
||||
// enums cannot be declared inside of classes because the enum scope rules
|
||||
// changed from V2 to V3 compilers causing incompatibilities
|
||||
//
|
||||
enum DtmFileLocality {
|
||||
Dtm_FL_UNKNOWN, // cannot determine file locality
|
||||
Dtm_FL_LOCAL, // file is local to this system (eg ufs)
|
||||
Dtm_FL_LOCAL_AND_REMOTE, // file is remote with local copy (eg cachefs)
|
||||
Dtm_FL_REMOTE // file is remote (e.g. nfs)
|
||||
};
|
||||
|
||||
class DtMail {
|
||||
public:
|
||||
|
||||
// Returns the minor code set by a DtMail routine. This method
|
||||
// should only be called if error._major is not NO_EXCEPTION.
|
||||
//
|
||||
// Parameters:
|
||||
// error - The environment returned from any DtMail method.
|
||||
//
|
||||
// Returns - The error code as defined in DtMailError.h
|
||||
//
|
||||
static DTMailError_t getMinorCode(DtMailEnv & error);
|
||||
|
||||
// Returns the internationalized error text for an error. This
|
||||
// method should only be called if error._major is not NO_EXCEPTION.
|
||||
//
|
||||
// Parameters:
|
||||
// error - The environment returned from any DtMail method.
|
||||
//
|
||||
// Returns - The error text string. This string is valid until
|
||||
// error.clear() is called on the error.
|
||||
//
|
||||
static const char * getErrorString(DtMailEnv & error);
|
||||
|
||||
// Determine locality of referenced path object
|
||||
// This is not part of the public interface, do not call
|
||||
// as a client of this class.
|
||||
static enum DtmFileLocality DetermineFileLocality(const char * path);
|
||||
|
||||
class MailBox;
|
||||
class Message;
|
||||
class Transport;
|
||||
|
||||
class MailRc;
|
||||
|
||||
class Session : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
Session(DtMailEnv &, const char * app_name);
|
||||
~Session(void);
|
||||
|
||||
const char ** enumerateImpls(DtMailEnv & error);
|
||||
void setDefaultImpl(DtMailEnv & error, const char * impl);
|
||||
const char * getDefaultImpl(DtMailEnv & error);
|
||||
void queryImpl(DtMailEnv & error,
|
||||
const char * impl,
|
||||
const char * capability,
|
||||
...);
|
||||
void queryImplV(DtMailEnv & error,
|
||||
const char * impl,
|
||||
const char * capability,
|
||||
va_list args);
|
||||
|
||||
// Create a mail box object, after selecting an implementation.
|
||||
MailBox * mailBoxConstruct(DtMailEnv & error,
|
||||
DtMailObjectSpace space,
|
||||
void * arg,
|
||||
DtMailCallback open_callback,
|
||||
void * client_data,
|
||||
const char * impl = NULL);
|
||||
|
||||
Message * messageConstruct(DtMailEnv & error,
|
||||
DtMailObjectSpace space,
|
||||
void * arg,
|
||||
DtMailCallback open_callback,
|
||||
void * client_data,
|
||||
const char * impl = NULL);
|
||||
|
||||
// Create a transport object after selecting an implementation.
|
||||
Transport * transportConstruct(DtMailEnv & error,
|
||||
const char * impl,
|
||||
DtMailStatusCallback call_back,
|
||||
void * client_data);
|
||||
|
||||
// Retrieve a copy of the MailRc handle.
|
||||
MailRc * mailRc(DtMailEnv & error);
|
||||
|
||||
// The following methods set up the polling requirements for
|
||||
// the DtMail library.
|
||||
//
|
||||
DtMailBoolean pollRequired(DtMailEnv & error);
|
||||
|
||||
int eventFileDesc(DtMailEnv & error);
|
||||
|
||||
void poll(DtMailEnv & error);
|
||||
|
||||
// The expandPath method will turn a relative path, with
|
||||
// variable's into an absolute path, relative to the current
|
||||
// network node.
|
||||
//
|
||||
char * expandPath(DtMailEnv & error, const char * path);
|
||||
char * getRelativePath(DtMailEnv & error, const char * path);
|
||||
|
||||
// Accessors to session data.
|
||||
const char * appName(void) const { return _app_name; }
|
||||
char * ttChannel(void) const { return _tt_channel; }
|
||||
int ttFile(void) const { return _tt_fd; }
|
||||
|
||||
// Meta factory type. This method gives access to the
|
||||
// factory and the implementations specific query
|
||||
// mechanisms.
|
||||
typedef void * (*MetaImplFactory)(const char * operation);
|
||||
|
||||
// The setError method needs to be here so it can be accessed
|
||||
// by the drivers.
|
||||
//
|
||||
void setError(DtMailEnv & error, const DTMailError_t);
|
||||
|
||||
// Add an event routine.
|
||||
void addEventRoutine(DtMailEnv &,
|
||||
DtMailEventFunc,
|
||||
void * client_data,
|
||||
time_t interval);
|
||||
|
||||
// Remove an event routine.
|
||||
void removeEventRoutine(DtMailEnv &,
|
||||
DtMailEventFunc,
|
||||
void * client_data);
|
||||
|
||||
// Push some data into the event queue.
|
||||
//
|
||||
void writeEventData(DtMailEnv & error,
|
||||
const void * buf,
|
||||
const unsigned long size);
|
||||
|
||||
// These routines check the list to make sure the created
|
||||
// object is still valid. This is used by the event handlers
|
||||
// to make sure events don't appear for deleted objects.
|
||||
//
|
||||
DtMailBoolean validObjectKey(DtMailObjectKey);
|
||||
DtMailObjectKey newObjectKey(void);
|
||||
void removeObjectKey(DtMailObjectKey);
|
||||
|
||||
// This method allows the client to register a busy callback.
|
||||
// Any time the library is going to be busy for a while, it will
|
||||
// call this handler to set the app state to busy, and unbusy
|
||||
// the app when it is done. This is an optional interface.
|
||||
//
|
||||
typedef void (*BusyApplicationCallback)(DtMailEnv &error,
|
||||
DtMailBusyState busy_state,
|
||||
void * client_data);
|
||||
void registerBusyCallback(DtMailEnv &,
|
||||
BusyApplicationCallback,
|
||||
void * client_data);
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
void unregisterBusyCallback(DtMailEnv &);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
void setBusyState(DtMailEnv &, DtMailBusyState busy_state);
|
||||
|
||||
void setAutoSaveFlag(DtMailBoolean flag);
|
||||
DtMailBoolean getAutoSaveFlag();
|
||||
|
||||
// These methods allow disabling and enabling of group privileges
|
||||
//
|
||||
typedef void (*DisableGroupPrivilegesCallback)(void * client_data);
|
||||
typedef void (*EnableGroupPrivilegesCallback)(void * client_data);
|
||||
|
||||
void registerDisableGroupPrivilegesCallback(
|
||||
DisableGroupPrivilegesCallback,
|
||||
void * client_data);
|
||||
void registerEnableGroupPrivilegesCallback(
|
||||
EnableGroupPrivilegesCallback,
|
||||
void * client_data);
|
||||
|
||||
void disableGroupPrivileges(void);
|
||||
void enableGroupPrivileges(void);
|
||||
|
||||
// This method allows the client to register a callback that
|
||||
// can be called to return the last time() an interactive X
|
||||
// event was processed.
|
||||
// Any time the library is about to be busy for a while, it
|
||||
// may call this handler to get the time() that the last
|
||||
// interactive X event was processed. It was very recent, the
|
||||
// library may wish to delay the busy event for a while.
|
||||
//
|
||||
typedef long (*LastInteractiveEventTimeCallback)(void * client_data);
|
||||
|
||||
void registerLastInteractiveEventTimeCallback(
|
||||
LastInteractiveEventTimeCallback,
|
||||
void * client_data);
|
||||
|
||||
long lastInteractiveEventTime(void);
|
||||
|
||||
// For CHARSET
|
||||
int OpenLcxDb(void);
|
||||
void DtXlateStdToOpLocale(char *op, char *std, char *dflt,
|
||||
char **ret);
|
||||
void DtXlateOpToStdLocale(char *op, char *opLoc, char **retLoc,
|
||||
char **ret_retLang, char **retSet);
|
||||
void DtXlateStdToOpCodeset(char *op, char *std, char *dflt,
|
||||
char **ret);
|
||||
void DtXlateMimeToIconv(const char *, const char *, const char *,
|
||||
char **, char **);
|
||||
void DtXlateLocaleToMime(const char *, const char *,
|
||||
const char *, char **);
|
||||
|
||||
char *csToConvName(char *);
|
||||
char *locToConvName();
|
||||
char *targetConvName();
|
||||
char *targetTagName();
|
||||
char *targetTagName(char *);
|
||||
int csConvert(char **, unsigned long &, int, char *, char *);
|
||||
// End of For CHARSET
|
||||
|
||||
private:
|
||||
unsigned long _object_signature;
|
||||
void *_obj_mutex;
|
||||
char * _tt_channel;
|
||||
int _tt_fd;
|
||||
int _event_fd[2];
|
||||
char *_app_name;
|
||||
MailRc * _mail_rc;
|
||||
DtMailBoolean _canAutoSave;
|
||||
|
||||
/* Implementation structure. */
|
||||
struct Impls {
|
||||
char *impl_name;
|
||||
MetaImplFactory impl_meta_factory;
|
||||
void *impl_lib;
|
||||
};
|
||||
|
||||
Impls *_impls;
|
||||
const char **_impl_names; // Used to return names from enumerate.
|
||||
int _num_impls;
|
||||
int _default_impl;
|
||||
|
||||
struct EventRoutine : public DtCPlusPlusAllocator {
|
||||
DtMailEventFunc routine;
|
||||
void * client_data;
|
||||
time_t interval;
|
||||
time_t last_ran;
|
||||
};
|
||||
|
||||
DtVirtArray<EventRoutine *> _events;
|
||||
DtVirtArray<DtMailObjectKey> _valid_keys;
|
||||
DtMailObjectKey _cur_key;
|
||||
|
||||
void buildImplTable(DtMailEnv & error);
|
||||
void buildTypeTable(DtMailEnv & error);
|
||||
int lookupImpl(const char * impl);
|
||||
|
||||
BusyApplicationCallback _busy_cb;
|
||||
void * _busy_cb_data;
|
||||
|
||||
DisableGroupPrivilegesCallback _disableGroupPrivileges_cb;
|
||||
void * _disableGroupPrivileges_cb_data;
|
||||
|
||||
EnableGroupPrivilegesCallback _enableGroupPrivileges_cb;
|
||||
void * _enableGroupPrivileges_cb_data;
|
||||
|
||||
LastInteractiveEventTimeCallback _interactive_time_cb;
|
||||
void * _interactive_time_cb_data;
|
||||
};
|
||||
|
||||
//==================NEW MAILRC CLASS
|
||||
class MailRc {
|
||||
|
||||
public:
|
||||
|
||||
MailRc(DtMailEnv &, Session *);
|
||||
|
||||
~MailRc();
|
||||
|
||||
int encryptedLength(int length);
|
||||
void encryptValue(char *to, char *from, int length);
|
||||
int decryptValue(char *to, char *from, int length);
|
||||
|
||||
void getValue(
|
||||
DtMailEnv &,
|
||||
const char * var, const char ** value,
|
||||
DtMailBoolean decrypt = DTM_FALSE);
|
||||
void setValue(
|
||||
DtMailEnv &,
|
||||
const char * var, const char * value,
|
||||
DtMailBoolean encrypt = DTM_FALSE);
|
||||
void removeValue(DtMailEnv &, const char * var);
|
||||
|
||||
const char * getAlias(DtMailEnv &, const char * name);
|
||||
typedef void (*hm_callback)(char * key, void * value,
|
||||
void * client_data);
|
||||
void getAliasList(hm_callback stuffing_func, void *client_data);
|
||||
void setAlias(DtMailEnv &, const char * name, const char * value);
|
||||
void removeAlias(DtMailEnv &, const char * name);
|
||||
DtVirtArray<char *> *getAliasList();
|
||||
|
||||
DtMailBoolean ignore(DtMailEnv &, const char *name);
|
||||
void addIgnore(DtMailEnv &, const char * name);
|
||||
void removeIgnore(DtMailEnv &, const char * name);
|
||||
DtVirtArray<char *> *getIgnoreList();
|
||||
|
||||
const char * getAlternates(DtMailEnv &);
|
||||
void setAlternate(DtMailEnv &, const char * alt);
|
||||
void removeAlternate(DtMailEnv &, const char * alt);
|
||||
|
||||
void update(DtMailEnv &);
|
||||
|
||||
|
||||
// Methods below this line are not part of the public interface.
|
||||
// They must be declared public due to implementation restrictions.
|
||||
// DO NOT CALL THESE AS A CLIENT OF THIS CLASS.
|
||||
//
|
||||
int load(char *filename, char* line);
|
||||
void init_globals();
|
||||
static void add_alias(char *name, char *value);
|
||||
static void mt_assign(char *name,char * val);
|
||||
static int mt_deassign(char *s);
|
||||
static void mt_puthash(
|
||||
char *name,
|
||||
char * val,
|
||||
struct var **hasharray);
|
||||
static void mt_scan(FILE * outf);
|
||||
static char *vcopy(char *str);
|
||||
static int group(char **argv, DtMail::MailRc *);
|
||||
static void wgroup(const char *, char **, FILE *);
|
||||
static void ngroup(char * key, void * value, void * client_data);
|
||||
static void nalias(char * key, void * data, void * client_data);
|
||||
static void nignorelist(char *key, void *data, void *client_data);
|
||||
static int unset(char **arglist, DtMail::MailRc *);
|
||||
static void wunset(
|
||||
const char * verbatim,
|
||||
char ** arglist,
|
||||
FILE * outf);
|
||||
static int set(char **arglist, DtMail::MailRc *);
|
||||
static void wset(const char *, char **, FILE *);
|
||||
static int source(char **arglist, DtMail::MailRc *);
|
||||
static void wsource(const char *, char **, FILE *);
|
||||
static int ifcmd(char **arglist, DtMail::MailRc *);
|
||||
static void wifcmd(const char *, char **, FILE *);
|
||||
static int elsecmd(char **arglist, DtMail::MailRc *);
|
||||
static void welsecmd(const char *, char **, FILE *);
|
||||
static int endifcmd(char **arglist, DtMail::MailRc *);
|
||||
static void wendifcmd(const char *, char **, FILE *);
|
||||
static int igfield(char **list, DtMail::MailRc *);
|
||||
static void wigfield(const char *, char **, FILE *);
|
||||
static void nigfield(char * key, void * value, void * client_data);
|
||||
static int clearaliases(char **list, DtMail::MailRc *);
|
||||
static void wclearaliases(const char *, char **, FILE *);
|
||||
|
||||
static void *hm_alloc();
|
||||
static void *hm_test(struct hash **table, char *key);
|
||||
static void hm_delete(struct hash **table, char *key);
|
||||
static void hm_add(struct hash **table,
|
||||
char *key,
|
||||
void *value,
|
||||
int size);
|
||||
static void hm_mark(struct hash **table, char * key);
|
||||
static int hm_ismarked(struct hash **table, char * key);
|
||||
static void hm_scan(
|
||||
struct hash **table,
|
||||
hm_callback,
|
||||
void * client_data);
|
||||
static void free_hash(struct hash *h);
|
||||
static int hash_index(char *key);
|
||||
static void add_ignore(char *name);
|
||||
static void add_alternates(char *name);
|
||||
static int alternates(char **namelist, DtMail::MailRc *);
|
||||
static void walternates(const char *, char **, FILE *);
|
||||
static void nalternates(
|
||||
char * key,
|
||||
void * value,
|
||||
void * client_data);
|
||||
|
||||
static char *nullfield;
|
||||
static Boolean clearAliases;
|
||||
|
||||
struct globals {
|
||||
char *g_myname;
|
||||
void *g_ignore; /* hash list of ignored fields */
|
||||
void *g_retain; /* hash list of retained fields */
|
||||
void *g_alias; /* hash list of alias names */
|
||||
void *g_alternates; /* hash list of alternate names */
|
||||
int g_nretained; /* the number of retained fields */
|
||||
};
|
||||
|
||||
static struct globals glob;
|
||||
|
||||
/* Pointer to active var list */
|
||||
static struct var *variables[HSHSIZE];
|
||||
|
||||
DTMailError_t getParseError(void) { return _parseError; }
|
||||
|
||||
protected:
|
||||
void updateByLine(FILE * in, FILE * out);
|
||||
void outputLine(
|
||||
const char * verbatim,
|
||||
const char * parseable,
|
||||
FILE * out);
|
||||
int commands(char* line);
|
||||
int execute(char linebuf[]);
|
||||
int readline(FILE *ibuf, char *linebuf);
|
||||
void unstack();
|
||||
int isprefix(char *as1, char *as2);
|
||||
void *lex(char word[]);
|
||||
int getrawlist(char line[], char ** argv, int argc);
|
||||
void freerawlist(char **argv);
|
||||
char *mt_value(char name[]);
|
||||
char *expand(char *);
|
||||
int getfolderdir(char *);
|
||||
static int hash(char *name);
|
||||
static void vfree(char *cp);
|
||||
|
||||
private:
|
||||
|
||||
DTMailError_t _parseError;
|
||||
FILE *input;
|
||||
int sourcing;
|
||||
int cond;
|
||||
int ssp; /* Top of file stack */
|
||||
char *alternate_list;
|
||||
char *_mailrc_name;
|
||||
|
||||
static struct var *lookup(char *name, struct var **hasharray);
|
||||
|
||||
|
||||
struct sstack {
|
||||
FILE *s_file; /* File we were in. */
|
||||
int s_cond; /* Saved state of conditionals */
|
||||
};
|
||||
|
||||
struct sstack sstack[MAILRC_NOFILE];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
class Envelope;
|
||||
class BodyPart;
|
||||
|
||||
class Message : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
virtual ~Message(void);
|
||||
|
||||
virtual Envelope * getEnvelope(DtMailEnv &) = 0;
|
||||
|
||||
// This should only be used when you REALLY need to know
|
||||
// how many body parts are present before actually traversing
|
||||
// the body parts (i.e. like when writing a MIME format message).
|
||||
virtual int getBodyCount(DtMailEnv &) = 0;
|
||||
|
||||
virtual BodyPart * getFirstBodyPart(DtMailEnv &) = 0;
|
||||
virtual BodyPart * getNextBodyPart(DtMailEnv &,
|
||||
BodyPart * last) = 0;
|
||||
|
||||
virtual BodyPart * newBodyPart(DtMailEnv &,
|
||||
BodyPart * after) = 0;
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
virtual void newBodyPartOrder(DtMailEnv &,
|
||||
BodyPart * new_order,
|
||||
const int bodypart_count) = 0;
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
virtual void setFlag(DtMailEnv &,
|
||||
const DtMailMessageState) = 0;
|
||||
|
||||
virtual void resetFlag(DtMailEnv &,
|
||||
const DtMailMessageState) = 0;
|
||||
|
||||
virtual DtMailBoolean flagIsSet(DtMailEnv &,
|
||||
const DtMailMessageState) = 0;
|
||||
|
||||
virtual time_t getDeleteTime(DtMailEnv &) = 0;
|
||||
|
||||
virtual void toBuffer(DtMailEnv & error, DtMailBuffer &) = 0;
|
||||
|
||||
virtual const char * impl(DtMailEnv & error) = 0;
|
||||
|
||||
// The mail box method is used by the components of
|
||||
// the message object to determine which mail box the
|
||||
// belong to, and in turn which session.
|
||||
//
|
||||
MailBox * mailBox(void);
|
||||
Session * session(void);
|
||||
|
||||
|
||||
protected:
|
||||
Message(DtMailEnv &,
|
||||
MailBox * parent);
|
||||
|
||||
MailBox * _parent;
|
||||
Session * _session;
|
||||
Envelope * _envelope;
|
||||
void * _obj_mutex;
|
||||
};
|
||||
|
||||
class Envelope : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
virtual DtMailHeaderHandle getFirstHeader(
|
||||
DtMailEnv &,
|
||||
char ** name,
|
||||
DtMailValueSeq & value) = 0;
|
||||
|
||||
virtual DtMailHeaderHandle getNextHeader(
|
||||
DtMailEnv &,
|
||||
DtMailHeaderHandle last,
|
||||
char ** name,
|
||||
DtMailValueSeq & value) = 0;
|
||||
|
||||
virtual void getHeader(DtMailEnv &,
|
||||
const char * name,
|
||||
const DtMailBoolean abstract,
|
||||
DtMailValueSeq & value) = 0;
|
||||
|
||||
virtual void setHeaderSeq(DtMailEnv &,
|
||||
const char * header_name,
|
||||
const DtMailValueSeq & val) = 0;
|
||||
|
||||
// The last parameter is left to the client to provide
|
||||
// because it can not be done in a type safe manner.
|
||||
//
|
||||
virtual void setHeader(DtMailEnv &,
|
||||
const char * header_name,
|
||||
const DtMailBoolean replace,
|
||||
const char *) = 0;
|
||||
|
||||
virtual void removeHeader(DtMailEnv &,
|
||||
const char * header_name) = 0;
|
||||
//
|
||||
// fix for the defect 177527
|
||||
// when a reply-to field is in a message headers, the reply-to is
|
||||
// going to be displayed as the send in RMW's msg list scrolled window
|
||||
// instead of the real sender. The following three public methods are
|
||||
// going to access _use_reply_to.
|
||||
//
|
||||
virtual void setUseReplyTo(void) = 0;
|
||||
virtual void unsetUseReplyTo(void) = 0;
|
||||
virtual DtMailBoolean getUseReplyTo(void) = 0;
|
||||
|
||||
|
||||
protected:
|
||||
Envelope(DtMailEnv & error, Message * parent);
|
||||
|
||||
friend Message::~Message(void);
|
||||
virtual ~Envelope(void); // Only called from Message destructor.
|
||||
|
||||
void * _obj_mutex;
|
||||
Message * _parent;
|
||||
};
|
||||
|
||||
class BodyPart : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
|
||||
virtual void lockContents(DtMailEnv &, const DtMailLock) = 0;
|
||||
virtual void unlockContents(DtMailEnv &) = 0;
|
||||
|
||||
virtual void getContents(DtMailEnv &,
|
||||
const void ** contents,
|
||||
unsigned long * length,
|
||||
char ** type,
|
||||
char ** name,
|
||||
int * mode,
|
||||
char ** description) = 0;
|
||||
|
||||
virtual void getContentType(DtMailEnv &,
|
||||
char ** content_type) = 0;
|
||||
|
||||
virtual void setContents(DtMailEnv &,
|
||||
const void * contents,
|
||||
const unsigned long length,
|
||||
const char * type,
|
||||
const char * name,
|
||||
const int mode,
|
||||
const char * description) = 0;
|
||||
|
||||
virtual void setFlag(DtMailEnv &,
|
||||
DtMailBodyPartState) = 0;
|
||||
|
||||
virtual void resetFlag(DtMailEnv &,
|
||||
DtMailBodyPartState) = 0;
|
||||
|
||||
virtual DtMailBoolean flagIsSet(DtMailEnv &,
|
||||
DtMailBodyPartState) = 0;
|
||||
|
||||
virtual time_t getDeleteTime(DtMailEnv &) = 0;
|
||||
|
||||
virtual void getHeader(DtMailEnv &,
|
||||
const char * name,
|
||||
const DtMailBoolean abstract,
|
||||
DtMailValueSeq & value) = 0;
|
||||
|
||||
// For CHARSET
|
||||
//-------------------------------------------
|
||||
// These methods are duplicated in class BodyPart
|
||||
// (also being implemented in class Session) because
|
||||
// RFCFormat and RFCBodyPart need to access them.
|
||||
// Duplicating routines like what is being done here is a workaround
|
||||
// for an implementation bug/hole because there is no class where global
|
||||
// routines can be defined (and be accessed by any class).
|
||||
// class Session is not a proper place to put (global) methods because
|
||||
// not every class can get at Session.
|
||||
// RFCFormat accesses these routines through its private Session handle.
|
||||
// RFCBodyPart does not have a Session handle.
|
||||
// Hence the need to duplicate the following routines.
|
||||
|
||||
virtual int OpenLcxDb(void) = 0;
|
||||
virtual void DtXlateStdToOpLocale(char *op, char *std, char *dflt,
|
||||
char **ret) = 0;
|
||||
virtual void DtXlateOpToStdLocale(char *op, char *opLoc, char **retLoc,
|
||||
char **ret_retLang, char **retSet) = 0;
|
||||
virtual void DtXlateMimeToIconv(const char *, const char *,
|
||||
const char *, char **, char **) = 0;
|
||||
virtual void DtXlateLocaleToMime(const char *, const char *,
|
||||
const char *, char **) = 0;
|
||||
|
||||
virtual char *csToConvName(char *) = 0;
|
||||
virtual char *locToConvName() = 0;
|
||||
virtual char *targetConvName() = 0;
|
||||
virtual char *targetTagName() = 0;
|
||||
virtual int csConvert(char **, unsigned long &, int,
|
||||
char *, char *) = 0;
|
||||
//-------------------------------------------
|
||||
|
||||
virtual char *csFromContentType(DtMailValueSeq & value) = 0;
|
||||
// End of For CHARSET
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
virtual DtMailChecksumState checksum(DtMailEnv &) = 0;
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
protected:
|
||||
BodyPart(DtMailEnv &, Message * parent);
|
||||
|
||||
friend Message::~Message(void);
|
||||
virtual ~BodyPart(void); // Only called from Message destructor.
|
||||
|
||||
void * _obj_mutex;
|
||||
Message * _parent;
|
||||
};
|
||||
|
||||
|
||||
// The MailBox encapsulates the concept of a mail box as a container.
|
||||
// This class should be used for manipulating mail containers.
|
||||
|
||||
class MailBox : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
|
||||
// Create a MailBox. The constructor simply initializes the
|
||||
// instance and sets the appropriate meta handlers for mail
|
||||
// containers.
|
||||
//
|
||||
// Errors:
|
||||
// None.
|
||||
//
|
||||
MailBox(DtMailEnv &,
|
||||
Session * session,
|
||||
DtMailObjectSpace space,
|
||||
void * arg,
|
||||
DtMailCallback cb,
|
||||
void * clientData);
|
||||
|
||||
// Returns DTM_TRUE if the is mail box is writable and DTM_FALSE
|
||||
// if the mail box is read only.
|
||||
//
|
||||
DtMailBoolean mailBoxWritable(DtMailEnv &);
|
||||
|
||||
// Destroy a MailBox. The destructor will close the open mail
|
||||
// container, and any embedded containers.
|
||||
//
|
||||
virtual ~MailBox(void);
|
||||
|
||||
static void appendCB(DtMailEnv&, char*, int, void *clientData);
|
||||
virtual void append(DtMailEnv &error, char *buf, int len) = 0;
|
||||
|
||||
// Create a named mail container in the file system. The
|
||||
// container will be truncated if it already exists, otherwise
|
||||
// it will be created. The mode in this case will be set to
|
||||
// DTMAIL_DEFAULT_CREATE_MODE, the default for mail.
|
||||
//
|
||||
// Errors:
|
||||
// DTME_ObjectInvalid - The instance was not proprerly initialized.
|
||||
// DTME_BadArg - The file_name parameter was invalid.
|
||||
// DTME_ObjectInUse - This object already has an open container.
|
||||
// DTME_ObjectCreationFailed - A required object could not
|
||||
// be created.
|
||||
//
|
||||
virtual void create(DtMailEnv &,
|
||||
mode_t mode = DTMAIL_DEFAULT_CREATE_MODE) = 0;
|
||||
|
||||
// Open a named mail container in the file system. The container
|
||||
// must exist, and be readable (at least) by the user.
|
||||
// If the container is writable by the user it will be opened
|
||||
// for update.
|
||||
//
|
||||
// Parameters:
|
||||
// auto_create - Create the container if it doesn't exist, using
|
||||
// MailBox::create.
|
||||
//
|
||||
// Errors:
|
||||
// DTME_ObjectInvalid - The instance was not proprerly initialized.
|
||||
// DTME_BadArg - The file_name parameter was invalid.
|
||||
// DTME_ObjectInUse - This object already has an open container.
|
||||
// DTME_ObjectCreationFailed - A required object could not
|
||||
// be created.
|
||||
// DTME_NoSuchFile - The file doesn't exist & auto_create is false.
|
||||
// DTME_NotMailBox - The object is a container, but not a mail box.
|
||||
// DTME_NoMemory - A memory allocation failed.
|
||||
//
|
||||
virtual void open(DtMailEnv & error,
|
||||
DtMailBoolean auto_create = DTM_TRUE,
|
||||
int open_mode = DTMAIL_DEFAULT_OPEN_MODE,
|
||||
mode_t create_mode = DTMAIL_DEFAULT_CREATE_MODE,
|
||||
DtMailBoolean lock_flag = DTM_TRUE,
|
||||
DtMailBoolean auto_parse = DTM_TRUE) = 0;
|
||||
|
||||
// (Un)locks an open mailbox.
|
||||
virtual void lock() = 0;
|
||||
virtual void unlock() = 0;
|
||||
virtual void save() = 0;
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
virtual int messageCount(DtMailEnv & error) = 0;
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
virtual DtMailMessageHandle getFirstMessageSummary(
|
||||
DtMailEnv & error,
|
||||
const DtMailHeaderRequest & header_list,
|
||||
DtMailHeaderLine & header_line) = 0;
|
||||
|
||||
virtual DtMailMessageHandle getNextMessageSummary(
|
||||
DtMailEnv & error,
|
||||
DtMailMessageHandle last,
|
||||
const DtMailHeaderRequest & header_list,
|
||||
DtMailHeaderLine & header_line) = 0;
|
||||
|
||||
virtual void getMessageSummary(
|
||||
DtMailEnv & error,
|
||||
DtMailMessageHandle handle,
|
||||
const DtMailHeaderRequest &,
|
||||
DtMailHeaderLine &) = 0;
|
||||
|
||||
virtual void clearMessageSummary(
|
||||
DtMailHeaderLine &) = 0;
|
||||
|
||||
virtual Message * getMessage(
|
||||
DtMailEnv & error,
|
||||
DtMailMessageHandle message_handle) = 0;
|
||||
|
||||
virtual Message * getFirstMessage(DtMailEnv &) = 0;
|
||||
|
||||
virtual Message * getNextMessage(DtMailEnv &, Message * last) = 0;
|
||||
|
||||
virtual Message * newMessage(DtMailEnv &) = 0;
|
||||
|
||||
virtual void copyMessage(DtMailEnv &, Message *) = 0;
|
||||
|
||||
virtual void copyMailBox(DtMailEnv &, MailBox *) = 0;
|
||||
|
||||
virtual void disableMailRetrieval() = 0;
|
||||
virtual void enableMailRetrieval() = 0;
|
||||
virtual void checkForMail(
|
||||
DtMailEnv &,
|
||||
const DtMailBoolean already_locked = DTM_FALSE) = 0;
|
||||
|
||||
virtual void createMailRetrievalAgent(char *password = NULL) = 0;
|
||||
virtual void deleteMailRetrievalAgent() = 0;
|
||||
virtual void updateMailRetrievalPassword(char *password = NULL) = 0;
|
||||
|
||||
virtual void expunge(DtMailEnv &) = 0;
|
||||
|
||||
virtual const char * impl(DtMailEnv & error) = 0;
|
||||
|
||||
// This method is typically used to propagate the session
|
||||
// to embedded objects, such as Messages which may need to
|
||||
// acquire the session to which it belongs.
|
||||
//
|
||||
virtual Session * session(void);
|
||||
|
||||
virtual void callCallback(DtMailCallbackOp, void *) = 0;
|
||||
virtual void startAutoSave(
|
||||
DtMailEnv & error,
|
||||
DtMailBoolean start=DTM_TRUE) = 0;
|
||||
typedef void (*err_func)(char *,Boolean,void *);
|
||||
void registerErrMsgFunc(err_func,void * client_data);
|
||||
void unregisterErrMsgFunc(DtMailEnv &);
|
||||
void showError(char *);
|
||||
|
||||
void hideAccessEvents(DtMailBoolean onoff)
|
||||
{_hide_access_events = onoff;}
|
||||
|
||||
DtMailObjectKey getObjectKey(void)
|
||||
{return _key;}
|
||||
|
||||
private:
|
||||
err_func _errmsg_func;
|
||||
void * _err_data;
|
||||
|
||||
|
||||
protected:
|
||||
DtMailBoolean _hide_access_events;
|
||||
|
||||
DtMailObjectKey _key;
|
||||
Session *_session;
|
||||
void *_arg;
|
||||
DtMailObjectSpace _space;
|
||||
DtMailCallback _callback;
|
||||
void *_cb_data;
|
||||
void *_obj_mutex;
|
||||
DtMailBoolean _mail_box_writable;
|
||||
mode_t _default_mode; // Default mode for file.
|
||||
};
|
||||
|
||||
class Transport : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
virtual DtMailOperationId submit(
|
||||
DtMailEnv &,
|
||||
Message * msg,
|
||||
DtMailBoolean log_msg = DTM_FALSE) = 0;
|
||||
|
||||
// SendMsgDialog initiates a send. It needs to set information
|
||||
// needed to exec sendmail by calling these init functions.
|
||||
// getSendmailReturnProc returns a handler so that SendMsgDialog
|
||||
// can use it in XtAppAddInput.
|
||||
virtual void initTransportData(int fds[2],
|
||||
SubProcessFinishedProc proc, void *ptr) = 0;
|
||||
virtual void *getSendmailReturnProc(void) = 0;
|
||||
|
||||
|
||||
virtual void callCallback(DtMailOperationId, void * arg);
|
||||
|
||||
protected:
|
||||
Transport(DtMailEnv &, Session *, DtMailStatusCallback, void *);
|
||||
virtual ~Transport(void);
|
||||
|
||||
DtMailObjectKey _key;
|
||||
Session * _session;
|
||||
DtMailStatusCallback _callback;
|
||||
void * _cb_data;
|
||||
void * _obj_mutex;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
friend class MailBox;
|
||||
friend class Message;
|
||||
friend class Envelope;
|
||||
friend class BodyPart;
|
||||
friend class Transport;
|
||||
friend class EmbeddedMessage;
|
||||
friend class FileMessage;
|
||||
friend class FileShare;
|
||||
friend class Session;
|
||||
static void setError(
|
||||
Session &,
|
||||
DtMailEnv & error,
|
||||
DTMailError_t minor_code);
|
||||
};
|
||||
|
||||
#endif
|
||||
412
cde/programs/dtmail/include/DtMail/DtMailError.hh
Normal file
412
cde/programs/dtmail/include/DtMail/DtMailError.hh
Normal file
@@ -0,0 +1,412 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $TOG: DtMailError.hh /main/15 1999/03/26 16:59:10 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTMAILERROR_H
|
||||
#define _DTMAILERROR_H
|
||||
|
||||
#include <DtMail/DtMailTypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <Tt/tt_c.h>
|
||||
#include <nl_types.h>
|
||||
|
||||
//
|
||||
// Name of the messaging database file.
|
||||
//
|
||||
extern const char * DtMailCatalogDataFile;
|
||||
static const int MailErrorSet = 1;
|
||||
static const int SockErrorSet = 2;
|
||||
static const int ValuesErrorSet = 2;
|
||||
static const int FileShareMsgSet = 2;
|
||||
|
||||
//
|
||||
// NOTE - IMPORTANT -- READ ME
|
||||
//
|
||||
// The order of the definitions below must match the
|
||||
// strings in libDtMail/Common/DtMailError.C
|
||||
//
|
||||
typedef enum {
|
||||
DTME_NoError,
|
||||
DTME_AlreadyLocked,
|
||||
DTME_BadArg,
|
||||
DTME_BadMailAddress,
|
||||
DTME_BadRunGroup,
|
||||
DTME_FileCreateFailed,
|
||||
DTME_FolderNotSet,
|
||||
DTME_GetLockRefused,
|
||||
DTME_ImplFailure,
|
||||
DTME_InitializationFailed,
|
||||
DTME_InternalFailure,
|
||||
DTME_InvalidError,
|
||||
DTME_InvalidOperationSequence,
|
||||
DTME_MD5ChecksumFailed,
|
||||
DTME_MailTransportFailed,
|
||||
DTME_NoDataType,
|
||||
DTME_NoImplementations,
|
||||
DTME_NoMailBox,
|
||||
DTME_NoMemory,
|
||||
DTME_NoMsgCat,
|
||||
DTME_NoNewMail,
|
||||
DTME_NoObjectValue,
|
||||
DTME_NoSuchFile,
|
||||
DTME_NoSuchImplementation,
|
||||
DTME_NoSuchType,
|
||||
DTME_NoUser,
|
||||
DTME_NotInbox,
|
||||
DTME_NotLocked,
|
||||
DTME_NotMailBox,
|
||||
DTME_NotSupported,
|
||||
DTME_ObjectAccessFailed,
|
||||
DTME_ObjectCreationFailed,
|
||||
DTME_ObjectInUse,
|
||||
DTME_ObjectInvalid,
|
||||
DTME_OpenContainerInterrupted,
|
||||
DTME_OperationInvalid,
|
||||
DTME_OtherOwnsWrite,
|
||||
DTME_RequestDenied,
|
||||
DTME_TTFailure,
|
||||
DTME_TransportFailed,
|
||||
DTME_UnknownFormat,
|
||||
DTME_UnknownOpenError,
|
||||
DTME_UserAbort,
|
||||
DTME_UserInterrupted,
|
||||
DTME_ObjectReadOnly,
|
||||
DTME_NoPermission,
|
||||
DTME_IsDirectory,
|
||||
DTME_CannotRemoveStaleMailboxLockFile,
|
||||
DTME_CannotCreateMailboxLockFile,
|
||||
DTME_CannotCreateMailboxLockFile_NoPermission,
|
||||
DTME_CannotCreateMailboxLockFile_IsDirectory,
|
||||
DTME_CannotCreateMailboxLockFile_NoSuchFile,
|
||||
DTME_CannotCreateMailboxLockFile_RemoteAccessLost,
|
||||
DTME_CannotObtainInformationOnOpenMailboxFile,
|
||||
DTME_CannotCreateTemporaryMailboxFile,
|
||||
DTME_CannotCreateTemporaryMailboxFile_NoPermission,
|
||||
DTME_CannotCreateTemporaryMailboxFile_IsDirectory,
|
||||
DTME_CannotCreateTemporaryMailboxFile_NoSuchFile,
|
||||
DTME_CannotCreateTemporaryMailboxFile_RemoteAccessLost,
|
||||
DTME_CannotSetPermissionsOfTemporaryMailboxFile,
|
||||
DTME_CannotSetOwnerOfTemporaryMailboxFile,
|
||||
DTME_CannotSetGroupOfTemporaryMailboxFile,
|
||||
DTME_CannotWriteToTemporaryMailboxFile,
|
||||
DTME_CannotWriteToTemporaryMailboxFile_ProcessLimitsExceeded,
|
||||
DTME_CannotWriteToTemporaryMailboxFile_RemoteAccessLost,
|
||||
DTME_CannotWriteToTemporaryMailboxFile_NoFreeSpaceLeft,
|
||||
DTME_CannotReadNewMailboxFile,
|
||||
DTME_CannotReadNewMailboxFile_OutOfMemory,
|
||||
DTME_CannotRemoveMailboxLockFile,
|
||||
DTME_CannotRenameNewMailboxFileOverOld,
|
||||
DTME_InternalAssertionFailure,
|
||||
DTME_ResourceParsingNoEndif,
|
||||
DTME_AlreadyOpened,
|
||||
DTME_OutOfSpace,
|
||||
DTME_CannotCreateMailboxDotDtmailLockFile,
|
||||
DTME_MailboxInodeChanged,
|
||||
DTME_MailServerAccess_AuthorizationFailed,
|
||||
DTME_MailServerAccess_Error,
|
||||
DTME_MailServerAccess_MissingPassword,
|
||||
DTME_MailServerAccess_ProtocolViolation,
|
||||
DTME_MailServerAccess_ServerTimeoutError,
|
||||
DTME_MailServerAccess_SocketIOError,
|
||||
DTME_AppendMailboxFile_Error,
|
||||
DTME_AppendMailboxFile_FileTooBig,
|
||||
DTME_AppendMailboxFile_LinkLost,
|
||||
DTME_AppendMailboxFile_NoSpaceLeft,
|
||||
DTME_AppendMailboxFile_SystemError,
|
||||
DTME_GetmailCommandRetrieval_SystemError,
|
||||
DTME_GetmailCommandRetrieval_AbnormalExit,
|
||||
DTME_PathElementPermissions,
|
||||
DTME_PathElementNotDirectory,
|
||||
DTME_PathElementDoesNotExist,
|
||||
DTME_MailServerAccessInfo_SocketOpen,
|
||||
DTME_MailServerAccessInfo_NoMessages,
|
||||
DTME_MailServerAccessInfo_RetrievingMessage,
|
||||
DTME_MailServerAccessInfo_MessageTooLarge,
|
||||
DTME_MAXDTME
|
||||
} DTMailError_t;
|
||||
|
||||
//
|
||||
// Make a class wrapper for errors so that we can set/clear
|
||||
// errors easier.
|
||||
//
|
||||
class DtMailEnv {
|
||||
public:
|
||||
|
||||
void clear(); // Sets everything to no error, and frees memory.
|
||||
|
||||
//
|
||||
// logError() and logFatalError():
|
||||
//
|
||||
// This will print out in a formated way all of the error information
|
||||
// that it can. it also sends the results to the system log device for
|
||||
// bug tracking.
|
||||
//
|
||||
// First it will format the error message to be returned.
|
||||
// Then if the _client message is set it will be printed.
|
||||
//
|
||||
// %m is used to insert the system supplied message into the supplied
|
||||
// format (see syslog(3)):
|
||||
//
|
||||
// error.logError(DTM_FALSE, "I got an error: number %d\n %m , error_code);
|
||||
//
|
||||
// The format may be in a system specific way.
|
||||
//
|
||||
void logError(DtMailBoolean criticalError,
|
||||
const char *format, ...) const;
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
//
|
||||
// This one is the same as logError() plus it sets _fatal.
|
||||
//
|
||||
void logFatalError(DtMailBoolean criticalError,
|
||||
const char *format, ...);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
//
|
||||
// Set the error code. Tt_message is optional.
|
||||
//
|
||||
// Fatal here is within the scope of the function called,
|
||||
// not necessarily the program. If the program can recover - it should.
|
||||
//
|
||||
void setError(const DTMailError_t,
|
||||
DtMailBoolean fatal,
|
||||
Tt_message = NULL);
|
||||
|
||||
void vSetError(const DTMailError_t minor_code,
|
||||
DtMailBoolean fatal,
|
||||
Tt_message msg,
|
||||
... );
|
||||
|
||||
void setError(const DTMailError_t,
|
||||
const Tt_message = NULL);
|
||||
|
||||
const char * errnoMessage(int systemErrorNumber);
|
||||
const char * errnoMessage();
|
||||
void setClient(void *);
|
||||
void * getClient(void) { return _client; }
|
||||
DtMailBoolean isSet() const; // Returns DTM_TRUE if there was an error.
|
||||
DtMailBoolean isNotSet() const; // !IsSet()
|
||||
DtMailBoolean isFatal() const;// Returns DTM_TRUE if the error was fatal.
|
||||
DtMailBoolean isNotFatal() const; // !IsFatal()
|
||||
|
||||
//
|
||||
// Cast operators. While:
|
||||
//
|
||||
// DtMailEnv error;
|
||||
//
|
||||
// // You can say....
|
||||
//
|
||||
// const Tt_message msg = (const Tt_message)error;
|
||||
//
|
||||
// const CMEnv env = (const CMEnv*)error;
|
||||
//
|
||||
// printf("%s %d", (const char*)error, (DTMailError_t)error);
|
||||
//
|
||||
operator const char*();
|
||||
operator const Tt_message() const;
|
||||
operator DTMailError_t() const;
|
||||
|
||||
//
|
||||
// Constructor/Destructor
|
||||
//
|
||||
DtMailEnv(); // The constructor will set everything to no error.
|
||||
|
||||
~DtMailEnv(); // Sets everything to no error, and frees memory.
|
||||
|
||||
//
|
||||
// Message catalog.
|
||||
//
|
||||
static nl_catd _errorCatalog;
|
||||
static char *getMessageText(int set, int msg, char *dft);
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
// The implementation specific function pointer and the _client
|
||||
// variable below was designed for use C++ API.
|
||||
//
|
||||
//
|
||||
// NOTES:
|
||||
// 1) CPP == C++.
|
||||
// 2) THESE FUNCTON POINTERS >>>EXPECT<<< TO CALL MT-SAFE FUNCTIONS.
|
||||
//
|
||||
// Implmentation specific error messages are here.
|
||||
// The pointer to the client data is in _client.
|
||||
//
|
||||
// Pointer to function for C++ 'clear', 'message', and
|
||||
// 'code' functions provided to this class from the implementation.
|
||||
// They are set using setCPP(...) function.
|
||||
//
|
||||
// This is for functions that use the C++ calling conventions.
|
||||
//
|
||||
// The CPPclearF points to a function provided by
|
||||
// the implementation to clear the error and free any
|
||||
// data assoicated with the _client specific data.
|
||||
//
|
||||
// The CPPmessageF points to a function provided by
|
||||
// the implementation to return the error 'message' assoicated with
|
||||
// the _client specific data.
|
||||
// --THE PROVIDED FUNCTION MUST RETURN NULL WHEN THERE IS NO ERROR.
|
||||
//
|
||||
// The CPPerrorF points to a function provided by
|
||||
// the implementation to return the error 'code' assoicated with
|
||||
// the _client specific data.
|
||||
// --THE PROVIDED FUNCTION MUST RETURN ZERO (0) WHEN THERE IS NO ERROR.
|
||||
//
|
||||
// void setClient(void *), sets the value of _client.
|
||||
//
|
||||
// C
|
||||
typedef void (*CPPclearF)(void *);
|
||||
typedef const char * (*CPPmessageF)(void *);
|
||||
typedef int (*CPPerrorF)(void *);
|
||||
|
||||
void setCPP(CPPclearF, CPPmessageF, CPPerrorF);
|
||||
|
||||
void implClear();
|
||||
#ifdef DEAD_WOOD
|
||||
const char * implGetMessage();
|
||||
int implGetError();
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
private:
|
||||
DTMailError_t _error; // The corrected error number.
|
||||
DTMailError_t _error_minor_code; // The original error number
|
||||
const char *_message; // The error message.
|
||||
Tt_message _tt_message; // ToolTalk error message.
|
||||
DtMailBoolean _fatal; // DTM_TRUE if this is a fatal error.
|
||||
void getErrorMessageText(void);
|
||||
|
||||
//
|
||||
// Function pointers for implementation specific clear,
|
||||
// get message, and get error functions.
|
||||
//
|
||||
CPPclearF _implClearFunc; // C function that will clear the error.
|
||||
CPPmessageF _implMessageFunc; // C function that will get the error msg.
|
||||
CPPerrorF _implErrorFunc; // C function that will get the error code.
|
||||
|
||||
//
|
||||
// Where the implementation stores the data.
|
||||
//
|
||||
void *_client; // Implmentation specific message.
|
||||
|
||||
//
|
||||
// Has syslog been opened?
|
||||
//
|
||||
static DtMailBoolean _syslog_open;
|
||||
|
||||
//
|
||||
// Message catalog.
|
||||
//
|
||||
static const char * DtMailCatalogDataFile;
|
||||
};
|
||||
|
||||
// Inline member functions.
|
||||
|
||||
inline void
|
||||
DtMailEnv::setCPP(CPPclearF clear, CPPmessageF message, CPPerrorF code)
|
||||
{
|
||||
_implClearFunc = clear;
|
||||
_implMessageFunc = message;
|
||||
_implErrorFunc = code;
|
||||
}
|
||||
|
||||
inline
|
||||
DtMailEnv::~DtMailEnv()
|
||||
{
|
||||
clear();
|
||||
if (_client)
|
||||
free(_client);
|
||||
}
|
||||
|
||||
inline void
|
||||
DtMailEnv::setError(const DTMailError_t err, const Tt_message msg)
|
||||
{
|
||||
setError(err, DTM_FALSE, msg);
|
||||
}
|
||||
|
||||
inline DtMailBoolean
|
||||
DtMailEnv::isSet() const
|
||||
{
|
||||
return(_error == DTME_NoError ? DTM_FALSE : DTM_TRUE);
|
||||
}
|
||||
|
||||
inline DtMailBoolean
|
||||
DtMailEnv::isNotSet() const
|
||||
{
|
||||
return(_error == DTME_NoError ? DTM_TRUE : DTM_FALSE);
|
||||
}
|
||||
|
||||
inline DtMailBoolean
|
||||
DtMailEnv::isFatal() const
|
||||
{
|
||||
return(_fatal);
|
||||
}
|
||||
|
||||
inline DtMailBoolean
|
||||
DtMailEnv::isNotFatal() const
|
||||
{
|
||||
return(_fatal == DTM_TRUE ? DTM_FALSE : DTM_TRUE);
|
||||
}
|
||||
|
||||
inline void
|
||||
DtMailEnv::setClient(void *client)
|
||||
{
|
||||
_client = client;
|
||||
}
|
||||
|
||||
inline
|
||||
DtMailEnv::operator const char*()
|
||||
{
|
||||
if (_message == NULL)
|
||||
getErrorMessageText();
|
||||
return(_message == NULL ? "Unknown" : _message);
|
||||
}
|
||||
|
||||
inline
|
||||
DtMailEnv::operator const Tt_message() const
|
||||
{
|
||||
return(_tt_message);
|
||||
}
|
||||
|
||||
inline
|
||||
DtMailEnv::operator DTMailError_t() const
|
||||
{
|
||||
return(_error);
|
||||
}
|
||||
|
||||
inline void
|
||||
DtMailEnv::implClear()
|
||||
{
|
||||
if (_client != NULL && _implClearFunc != NULL) {
|
||||
(*_implClearFunc)(_client);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
inline Tt_message
|
||||
DtMailError_getTTmsg(DtMailEnv & error)
|
||||
{
|
||||
return((const Tt_message)error); // The prefered way.
|
||||
}
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
#endif // _DTCM_HH
|
||||
|
||||
35
cde/programs/dtmail/include/DtMail/DtMailP.hh
Normal file
35
cde/programs/dtmail/include/DtMail/DtMailP.hh
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $XConsortium: DtMailP.hh /main/4 1996/04/21 19:44:46 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTMAILP_HH
|
||||
#define _DTMAILP_HH
|
||||
|
||||
// This method will write a single mail message to a file, in
|
||||
// the correct SVID format.
|
||||
//
|
||||
void RFCWriteMessage(DtMailEnv & error,
|
||||
DtMail::Session * session,
|
||||
const char * path,
|
||||
DtMail::Message * msg);
|
||||
|
||||
void DtMailProcessClientEvents(void);
|
||||
|
||||
#endif
|
||||
58
cde/programs/dtmail/include/DtMail/DtMailProps.h
Normal file
58
cde/programs/dtmail/include/DtMail/DtMailProps.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $TOG: DtMailProps.h /main/5 1998/02/17 12:33:15 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTMAILPROPS_H
|
||||
#define _DTMAILPROPS_H
|
||||
|
||||
/*
|
||||
* The following list of properties represent the abstract names
|
||||
* that are understood by the mail library.
|
||||
*/
|
||||
#define DtMailMessageTo "Dt:Mail:Message:To"
|
||||
#define DtMailMessageSender "Dt:Mail:Message:Sender"
|
||||
#define DtMailMessageCc "Dt:Mail:Message:Cc"
|
||||
#define DtMailMessageBcc "Dt:Mail:Message:Bcc"
|
||||
#define DtMailMessageReceivedTime "Dt:Mail:Message:ReceivedTime"
|
||||
#define DtMailMessageSentTime "Dt:Mail:Message:SentTime"
|
||||
#define DtMailMessageMessageId "Dt:Mail:Message:MessageId"
|
||||
#define DtMailMessageSubject "Dt:Mail:Message:Subject"
|
||||
#define DtMailMessageContentLength "Dt:Mail:Message:ContentLength"
|
||||
#define DtMailMessageStatus "Dt:Mail:Message:Status"
|
||||
#define DtMailMessageDeleteState "Dt:Mail:Message:Delete:State"
|
||||
#define DtMailMessageV3charset "Dt:Mail:Message:V3charset"
|
||||
#define DtMailMessageContentType "Dt:Mail:Message:ContentType"
|
||||
|
||||
/*
|
||||
* The following 2 headers are used to retrieve the To and CC lines,
|
||||
* modified for replying to the message. This may be different than
|
||||
* the entire To and CC contents.
|
||||
*/
|
||||
#define DtMailMessageToReply "Dt:Mail:Message:To:Reply"
|
||||
#define DtMailMessageCcReply "Dt:Mail:Message:Cc:Reply"
|
||||
|
||||
/* The following properties are defined for DtMailQueryImpl use. */
|
||||
#define DtMailCapabilityPropsSupported "Dt:Mail:Capability:PropsSupported"
|
||||
#define DtMailCapabilityImplVersion "Dt:Mail:Capability:ImplVersion"
|
||||
#define DtMailCapabilityInboxName "Dt:Mail:Capability:InboxName"
|
||||
#define DtMailCapabilityMailspoolName "Dt:Mail:Capability:MailspoolName"
|
||||
#define DtMailCapabilityTransport "Dt:Mail:Capability:Transport"
|
||||
|
||||
#endif
|
||||
397
cde/programs/dtmail/include/DtMail/DtMailServer.hh
Normal file
397
cde/programs/dtmail/include/DtMail/DtMailServer.hh
Normal file
@@ -0,0 +1,397 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $TOG: DtMailServer.hh /main/11 1999/01/29 11:49:00 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#ifndef _DTMAIL_SERVER_HH
|
||||
#define _DTMAIL_SERVER_HH
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <DtMail/DtMail.hh>
|
||||
#include <DtMail/DtMailTypes.h>
|
||||
#include <DtMail/DtVirtArray.hh>
|
||||
|
||||
#define DTMAS_INBOX "INBOX"
|
||||
|
||||
#define DTMAS_PROTO_NONE "NONE"
|
||||
#define DTMAS_PROTO_APOP "APOP"
|
||||
#define DTMAS_PROTO_AUTO "AUTO"
|
||||
#define DTMAS_PROTO_IMAP "IMAP"
|
||||
#define DTMAS_PROTO_POP2 "POP2"
|
||||
#define DTMAS_PROTO_POP3 "POP3"
|
||||
|
||||
/* definitions for buffer sizes -- somewhat arbitrary */
|
||||
#define DTMAS_TIMEOUT 10 /* timeout with server */
|
||||
#define DTMAS_IDSIZE 128 /* length of UIDL message ID */
|
||||
#define DTMAS_MSGBUFSIZE 4096 /* size of msg read buffer */
|
||||
#define DTMAS_POPBUFSIZE 512 /* per RFC 937 */
|
||||
#define DTMAS_TAGSIZE 6 /* len of tagged proto tag */
|
||||
|
||||
#define DTMAS_PROPKEY_GETMAILCOMMAND "getmailcommand"
|
||||
#define DTMAS_PROPKEY_GETMAILVIACOMMAND "getmailviacommand"
|
||||
#define DTMAS_PROPKEY_GETMAILVIASERVER "getmailviaserver"
|
||||
#define DTMAS_PROPKEY_GETMAILVIASYSTEM "getmailviasystem"
|
||||
#define DTMAS_PROPKEY_INBOXPATH "inboxpath"
|
||||
#define DTMAS_PROPKEY_PASSWORD "password"
|
||||
#define DTMAS_PROPKEY_PROTOCOL "protocol"
|
||||
#define DTMAS_PROPKEY_PROTOLOGGING "protologging"
|
||||
#define DTMAS_PROPKEY_PROTOLOGGINGPLUS "protologgingplus"
|
||||
#define DTMAS_PROPKEY_REMEMBERPASSWORD "rememberpassword"
|
||||
#define DTMAS_PROPKEY_REMOTENAME "remotename"
|
||||
#define DTMAS_PROPKEY_REMOVEAFTERDELIVERY "removeafterdelivery"
|
||||
#define DTMAS_PROPKEY_RETRIEVEOLD "retrieveold"
|
||||
#define DTMAS_PROPKEY_SERVERNAME "servername"
|
||||
#define DTMAS_PROPKEY_SHOWCONFIRMATION "showretrievalconfirmation"
|
||||
#define DTMAS_PROPKEY_TIMEOUT "timeout"
|
||||
#define DTMAS_PROPKEY_USERNAME "username"
|
||||
|
||||
#define DTMAS_PROPDFLT_GETMAILCOMMAND ""
|
||||
#define DTMAS_PROPDFLT_GETMAILVIACOMMAND "f"
|
||||
#define DTMAS_PROPDFLT_GETMAILVIASERVER "f"
|
||||
#define DTMAS_PROPDFLT_GETMAILVIASYSTEM ""
|
||||
#define DTMAS_PROPDFLT_PASSWORD ""
|
||||
#define DTMAS_PROPDFLT_PROTOCOL DTMAS_PROTO_POP3
|
||||
#define DTMAS_PROPDFLT_PROTOLOGGING "f"
|
||||
#define DTMAS_PROPDFLT_PROTOLOGGINGPLUS "f"
|
||||
#define DTMAS_PROPDFLT_REMEMBERPASSWORD "f"
|
||||
#define DTMAS_PROPDFLT_REMOVEAFTERDELIVERY ""
|
||||
#define DTMAS_PROPDFLT_RETRIEVEOLD ""
|
||||
#define DTMAS_PROPDFLT_SERVERNAME ""
|
||||
#define DTMAS_PROPDFLT_SHOWCONFIRMATION "f"
|
||||
#define DTMAS_PROPDFLT_TIMEOUT "30"
|
||||
|
||||
|
||||
#define DTMAS_PROTOCOL_ERROR(pname) \
|
||||
{ \
|
||||
if (_errorlogging) \
|
||||
{ \
|
||||
DtMailEnv error; \
|
||||
error.logError(DTM_FALSE, (const char*) "%s: protocol error\n", pname); \
|
||||
} \
|
||||
return PS_ERROR; \
|
||||
}
|
||||
|
||||
#define DTMAS_CONCAT_MAILRC_KEY(buf, pfx, key) \
|
||||
{ if (NULL==(pfx)) (void) sprintf((buf), "%s", (key)); \
|
||||
else (void) sprintf((buf), "%s_%s", (pfx), (key)); }
|
||||
|
||||
typedef void (*DtMailAppendCallback)(DtMailEnv&, char*, int, void*);
|
||||
|
||||
class DtMailServer : public DtCPlusPlusAllocator
|
||||
{
|
||||
public:
|
||||
friend class AUTOServer;
|
||||
|
||||
DtMailServer(char*, DtMail::Session*, DtMail::MailBox*,
|
||||
DtMailAppendCallback, void*);
|
||||
~DtMailServer();
|
||||
|
||||
static int get_mailrc_value(
|
||||
DtMail::Session*,
|
||||
char*, char*,
|
||||
int dflt = 0);
|
||||
static char *get_mailrc_value(
|
||||
DtMail::Session*,
|
||||
char*, char*,
|
||||
char*dflt = NULL,
|
||||
DtMailBoolean decrypt = DTM_FALSE);
|
||||
static Boolean get_mailrc_value(
|
||||
DtMail::Session*,
|
||||
char*, char*,
|
||||
Boolean dflt = False);
|
||||
void set_password(char *);
|
||||
virtual void retrieve_messages(DtMailEnv&);
|
||||
|
||||
protected:
|
||||
//
|
||||
// Protocol specific access methods
|
||||
//
|
||||
virtual DTMailError_t ptrans_authorize(char*) = 0;
|
||||
virtual DTMailError_t ptrans_delete(int) = 0;
|
||||
virtual int ptrans_msgisold(int) = 0;
|
||||
virtual DTMailError_t ptrans_fldstate_expunge() = 0;
|
||||
virtual DTMailError_t ptrans_fldstate_read(int*, int*)= 0;
|
||||
virtual DTMailError_t ptrans_msgsizes(int, int*) = 0;
|
||||
virtual DTMailError_t ptrans_parse_response(char*) = 0;
|
||||
virtual DTMailError_t ptrans_quit() = 0;
|
||||
virtual DTMailError_t ptrans_retrieve_start(int, int*) = 0;
|
||||
virtual DTMailError_t ptrans_retrieve_end(int) = 0;
|
||||
|
||||
//
|
||||
// Protocol specific characteristics
|
||||
//
|
||||
virtual int proto_is_delimited() = 0;
|
||||
virtual int proto_is_peek_capable() = 0;
|
||||
virtual int proto_is_tagged() = 0;
|
||||
virtual char *proto_name() = 0;
|
||||
virtual int proto_port() = 0;
|
||||
virtual int proto_requires_password() = 0;
|
||||
|
||||
//
|
||||
// Server related Access Protocol data
|
||||
//
|
||||
DtMailAppendCallback _append_mailbox_cb;
|
||||
void *_append_mailbox_cb_data;
|
||||
char *_errorstring;
|
||||
char *_folder;
|
||||
DtMailEnv _info;
|
||||
DtMailEnv _logger;
|
||||
char _msgbuf[DTMAS_MSGBUFSIZE];
|
||||
char *_password;
|
||||
Boolean _protologging;
|
||||
Boolean _protologgingplus;
|
||||
Boolean _removeafterdelivery;
|
||||
Boolean _retrieveold;
|
||||
int _retrieveerrors;
|
||||
char *_servername;
|
||||
DtMail::Session *_session;
|
||||
DtMail::MailBox *_mailbox;
|
||||
int _sizelimit;
|
||||
void *_sockfp;
|
||||
char *_shroud; // String to shroud in debug output.
|
||||
char _transtag[DTMAS_TAGSIZE];
|
||||
// Tag of the current transaction.
|
||||
int _transnum; // Number of the current transaction.
|
||||
int _timeout; // Timeout seconds waiting for server.
|
||||
char *_username;
|
||||
|
||||
//
|
||||
// Generic Access Protocol methods
|
||||
//
|
||||
DTMailError_t do_send(char *fmt, ...);
|
||||
DTMailError_t do_transaction(char *fmt, ...);
|
||||
Boolean is_inbox();
|
||||
DTMailError_t ptrans_retrieve_readandappend(DtMailEnv&, long);
|
||||
void send_info_message(DtMailCallbackOp);
|
||||
static void vtalarm_handler(int);
|
||||
void vtalarm_setitimer(int);
|
||||
};
|
||||
|
||||
class AUTOServer : public DtMailServer
|
||||
{
|
||||
public:
|
||||
AUTOServer(char*, DtMail::Session*, DtMail::MailBox*,
|
||||
DtMailAppendCallback, void*);
|
||||
~AUTOServer();
|
||||
|
||||
virtual void retrieve_messages(DtMailEnv&);
|
||||
|
||||
protected:
|
||||
//
|
||||
// Protocol specific methods
|
||||
//
|
||||
virtual DTMailError_t ptrans_authorize(char*);
|
||||
virtual DTMailError_t ptrans_delete(int);
|
||||
virtual int ptrans_msgisold(int);
|
||||
virtual DTMailError_t ptrans_fldstate_expunge();
|
||||
virtual DTMailError_t ptrans_fldstate_read(int*, int*);
|
||||
virtual DTMailError_t ptrans_msgsizes(int, int*);
|
||||
virtual DTMailError_t ptrans_parse_response(char*);
|
||||
virtual DTMailError_t ptrans_quit();
|
||||
virtual DTMailError_t ptrans_retrieve_start(int, int*);
|
||||
virtual DTMailError_t ptrans_retrieve_end(int);
|
||||
|
||||
//
|
||||
// Protocol characteristics
|
||||
//
|
||||
virtual int proto_is_delimited()
|
||||
{ return _server->proto_is_delimited(); }
|
||||
virtual int proto_is_peek_capable()
|
||||
{ return _server->proto_is_peek_capable(); }
|
||||
virtual int proto_is_tagged()
|
||||
{ return _server->proto_is_tagged(); }
|
||||
virtual char *proto_name()
|
||||
{ return _server->proto_name(); }
|
||||
virtual int proto_port()
|
||||
{ return _server->proto_port(); }
|
||||
virtual int proto_requires_password()
|
||||
{ return _server->proto_requires_password(); }
|
||||
|
||||
#define AUTO_POP3 0
|
||||
#define AUTO_APOP 1
|
||||
#define AUTO_IMAP 2
|
||||
#define AUTO_POP2 3
|
||||
#define AUTO_NPROTOCOLS 4
|
||||
|
||||
DtMailServer *_server;
|
||||
};
|
||||
|
||||
class IMAPServer : public DtMailServer
|
||||
{
|
||||
public:
|
||||
IMAPServer(char*, DtMail::Session*, DtMail::MailBox*,
|
||||
DtMailAppendCallback, void*);
|
||||
~IMAPServer();
|
||||
|
||||
virtual void retrieve_messages(DtMailEnv&);
|
||||
|
||||
protected:
|
||||
//
|
||||
// Protocol specific methods
|
||||
//
|
||||
virtual DTMailError_t ptrans_authorize(char*);
|
||||
virtual DTMailError_t ptrans_delete(int);
|
||||
virtual int ptrans_msgisold(int);
|
||||
virtual DTMailError_t ptrans_fldstate_expunge()
|
||||
{ return do_transaction("EXPUNGE"); }
|
||||
virtual DTMailError_t ptrans_fldstate_read(int*, int*);
|
||||
virtual DTMailError_t ptrans_msgsizes(int, int*);
|
||||
virtual DTMailError_t ptrans_parse_response(char*);
|
||||
virtual DTMailError_t ptrans_quit()
|
||||
{ return do_transaction("LOGOUT"); }
|
||||
virtual DTMailError_t ptrans_retrieve_start(int, int*);
|
||||
virtual DTMailError_t ptrans_retrieve_end(int);
|
||||
|
||||
//
|
||||
// Protocol characteristics
|
||||
//
|
||||
virtual int proto_is_delimited() { return FALSE; }
|
||||
virtual int proto_is_peek_capable() { return TRUE; }
|
||||
virtual int proto_is_tagged() { return TRUE; }
|
||||
virtual char *proto_name() { return strdup(DTMAS_PROTO_IMAP); }
|
||||
virtual int proto_port() { return 143; }
|
||||
virtual int proto_requires_password() { return TRUE; }
|
||||
|
||||
int _count;
|
||||
int _imap4;
|
||||
int _recent;
|
||||
int _seen;
|
||||
int _unseen;
|
||||
};
|
||||
|
||||
class POP2Server : public DtMailServer
|
||||
{
|
||||
public:
|
||||
POP2Server(char*, DtMail::Session*, DtMail::MailBox*,
|
||||
DtMailAppendCallback, void*);
|
||||
~POP2Server();
|
||||
|
||||
virtual void retrieve_messages(DtMailEnv&);
|
||||
|
||||
protected:
|
||||
//
|
||||
// Protocol specific methods
|
||||
//
|
||||
virtual DTMailError_t ptrans_authorize(char*);
|
||||
virtual DTMailError_t ptrans_delete(int)
|
||||
{ return DTME_NoError; }
|
||||
virtual int ptrans_msgisold(int);
|
||||
virtual DTMailError_t ptrans_fldstate_expunge()
|
||||
{ return DTME_NoError; }
|
||||
virtual DTMailError_t ptrans_fldstate_read(int*, int*);
|
||||
virtual DTMailError_t ptrans_msgsizes(int, int*);
|
||||
virtual DTMailError_t ptrans_parse_response(char*);
|
||||
virtual DTMailError_t ptrans_quit()
|
||||
{ return do_transaction("QUIT"); }
|
||||
virtual DTMailError_t ptrans_retrieve_start(int, int*);
|
||||
virtual DTMailError_t ptrans_retrieve_end(int);
|
||||
|
||||
//
|
||||
// Protocol characteristics
|
||||
//
|
||||
virtual int proto_is_delimited() { return FALSE; }
|
||||
virtual int proto_is_peek_capable() { return FALSE; }
|
||||
virtual int proto_is_tagged() { return FALSE; }
|
||||
virtual char *proto_name() { return strdup(DTMAS_PROTO_POP2); }
|
||||
virtual int proto_port() { return 109; }
|
||||
virtual int proto_requires_password() { return TRUE; }
|
||||
|
||||
int _pound_arg;
|
||||
int _equal_arg;
|
||||
};
|
||||
|
||||
|
||||
class POP3Server : public DtMailServer
|
||||
{
|
||||
public:
|
||||
POP3Server(char*, DtMail::Session*, DtMail::MailBox*,
|
||||
DtMailAppendCallback, void*);
|
||||
~POP3Server();
|
||||
|
||||
virtual void retrieve_messages(DtMailEnv&);
|
||||
|
||||
protected:
|
||||
//
|
||||
// Protocol specific methods
|
||||
//
|
||||
virtual DTMailError_t ptrans_authorize(char*);
|
||||
virtual DTMailError_t ptrans_delete(int);
|
||||
virtual int ptrans_msgisold(int);
|
||||
virtual DTMailError_t ptrans_fldstate_expunge()
|
||||
{ return DTME_NoError; }
|
||||
virtual DTMailError_t ptrans_fldstate_read(int*, int*);
|
||||
virtual DTMailError_t ptrans_msgsizes(int, int*);
|
||||
virtual DTMailError_t ptrans_parse_response(char*);
|
||||
virtual DTMailError_t ptrans_quit()
|
||||
{ return do_transaction("QUIT"); }
|
||||
virtual DTMailError_t ptrans_retrieve_start(int, int*);
|
||||
virtual DTMailError_t ptrans_retrieve_end(int)
|
||||
{ return DTME_NoError; }
|
||||
|
||||
//
|
||||
// Protocol characteristics
|
||||
//
|
||||
virtual int proto_is_delimited() { return TRUE; }
|
||||
virtual int proto_is_peek_capable() { return FALSE; }
|
||||
virtual int proto_is_tagged() { return FALSE; }
|
||||
virtual char *proto_name() { return strdup(DTMAS_PROTO_POP3); }
|
||||
virtual int proto_port() { return 110; }
|
||||
virtual int proto_requires_password() { return TRUE; }
|
||||
|
||||
int _lastretrieved;
|
||||
DtVirtArray<char*> *_uidlist_current;
|
||||
DtVirtArray<char*> *_uidlist_old;
|
||||
char *_uidlist_file;
|
||||
|
||||
DtVirtArray<char*> *uidlist_create();
|
||||
void uidlist_destroy(DtVirtArray<char*> *uidlist);
|
||||
char *uidlist_find(
|
||||
DtVirtArray<char*> *uidlist,
|
||||
int msg,
|
||||
char *uid);
|
||||
void uidlist_read(DtVirtArray<char*> *uidlist);
|
||||
void uidlist_write(DtVirtArray<char*> *uidlist);
|
||||
};
|
||||
|
||||
class APOPServer : public POP3Server
|
||||
{
|
||||
public:
|
||||
APOPServer(char*, DtMail::Session*, DtMail::MailBox*,
|
||||
DtMailAppendCallback, void*);
|
||||
~APOPServer();
|
||||
|
||||
protected:
|
||||
//
|
||||
// Protocol specific methods
|
||||
//
|
||||
virtual DTMailError_t ptrans_authorize(char*);
|
||||
|
||||
//
|
||||
// Protocol characteristics
|
||||
//
|
||||
virtual char *proto_name() { return strdup(DTMAS_PROTO_APOP); }
|
||||
virtual int proto_requires_password() { return TRUE; }
|
||||
};
|
||||
|
||||
#endif // _DTMAIL_SERVER_HH
|
||||
35
cde/programs/dtmail/include/DtMail/DtMailSigChld.h
Normal file
35
cde/programs/dtmail/include/DtMail/DtMailSigChld.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $XConsortium: DtMailSigChld.h /main/4 1996/04/21 19:44:52 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTMAILSIGCHLD_H
|
||||
#define _DTMAILSIGCHLD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void ChildExitNotify(const int pid, const int status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
173
cde/programs/dtmail/include/DtMail/DtMailTypes.h
Normal file
173
cde/programs/dtmail/include/DtMail/DtMailTypes.h
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $TOG: DtMailTypes.h /main/9 1998/11/10 17:02:58 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTMAILTYPES_H
|
||||
#define _DTMAILTYPES_H
|
||||
|
||||
#include <DtMail/DtMailValues.hh>
|
||||
|
||||
//
|
||||
// Default file open mode when creating a new mail file (i.e. folder),
|
||||
// or opening an existing one.
|
||||
// NOTE: there are two create modes, one for use if mail groups are not
|
||||
// required, and the other for use if mail groups are required. This
|
||||
// decision is made in the creating code
|
||||
|
||||
#define DTMAIL_DEFAULT_CREATE_MODE 0600
|
||||
#define DTMAIL_DEFAULT_CREATE_MODE_MAILGROUP 0660
|
||||
#define DTMAIL_DEFAULT_CREATE_UMASK 0177
|
||||
#define DTMAIL_DEFAULT_CREATE_UMASK_MAILGROUP 0117
|
||||
#define DTMAIL_DEFAULT_CREATE_MAILGROUP "mail"
|
||||
#define DTMAIL_DEFAULT_OPEN_MODE O_RDWR
|
||||
|
||||
|
||||
typedef void * DtMailSession;
|
||||
typedef void * DtMailMailBox;
|
||||
typedef void * DtMailMessage;
|
||||
typedef void * DtMailEnvelope;
|
||||
typedef void * DtMailBodyPart;
|
||||
typedef void * DtMailMessageHandle;
|
||||
typedef void * DtMailHeaderHandle;
|
||||
typedef void * DtMailTransport;
|
||||
typedef unsigned long DtMailObjectKey;
|
||||
|
||||
typedef enum { DTM_FALSE, DTM_TRUE } DtMailBoolean;
|
||||
|
||||
/*
|
||||
* The callback ops are passed back to the client when the DtMail library
|
||||
* needs information from the user. Additional operations can be defined by
|
||||
* specific implementations. These should begin after the DTMC_RESERVED constant.
|
||||
*/
|
||||
typedef enum {
|
||||
DTMC_NOOP = 0,
|
||||
DTMC_SAVE = 1,
|
||||
DTMC_REVERT = 2,
|
||||
DTMC_RAISE = 3,
|
||||
DTMC_PASSWD = 4,
|
||||
DTMC_NEWMAIL = 5,
|
||||
DTMC_DELETEMSG = 6,
|
||||
DTMC_BADSTATE = 7,
|
||||
DTMC_UNLOCK = 8,
|
||||
DTMC_LOSTLOCK = 9,
|
||||
DTMC_QUERYLOCK = 10,
|
||||
DTMC_READONLY = 11,
|
||||
DTMC_READWRITEOVERRIDE = 12,
|
||||
DTMC_DOTDTMAILLOCKFAILED = 13,
|
||||
DTMC_INODECHANGED = 14,
|
||||
DTMC_ACCESSFAILED = 15,
|
||||
DTMC_SERVERACCESSFAILED = 16,
|
||||
DTMC_SERVERPASSWORDNEEDED = 17,
|
||||
DTMC_GETMAILCOMMANDFAILED = 18,
|
||||
DTMC_SERVERACCESSINFO = 19,
|
||||
DTMC_SERVERACCESSINFOERROR = 20,
|
||||
DTMC_RESERVED = 8192
|
||||
} DtMailCallbackOp;
|
||||
|
||||
typedef DtMailBoolean (*DtMailCallback)(DtMailCallbackOp op,
|
||||
const char * path,
|
||||
const char * prompt_hint,
|
||||
void * client_data,
|
||||
...);
|
||||
|
||||
// This forward declaration is needed to resolve a circular dependency
|
||||
// between DtMailTypes.h and DtMailError.hh
|
||||
//
|
||||
class DtMailEnv;
|
||||
|
||||
typedef void * DtMailOperationId;
|
||||
typedef void (*DtMailStatusCallback)(DtMailOperationId,
|
||||
DtMailEnv & error,
|
||||
void * client_data);
|
||||
|
||||
typedef DtMailBoolean (*DtMailEventFunc)(void * client_data);
|
||||
|
||||
typedef struct {
|
||||
char ** header_name;
|
||||
int number_of_names;
|
||||
} DtMailHeaderRequest;
|
||||
|
||||
typedef struct {
|
||||
DtMailValueSeq *header_values;
|
||||
int number_of_names;
|
||||
} DtMailHeaderLine;
|
||||
|
||||
typedef enum {
|
||||
DtMailMessageNew = 1,
|
||||
DtMailMessageDeletePending = 2,
|
||||
DtMailMessageAnswered = 3,
|
||||
DtMailMessageMultipart = 4,
|
||||
DtMailMessagePartial = 8,
|
||||
DtMailMessageReservedLimit = 8192
|
||||
} DtMailMessageState;
|
||||
|
||||
typedef enum {
|
||||
DtMailBodyPartDeletePending = 1,
|
||||
DtMailBodyPartReservedLimit = 8192
|
||||
} DtMailBodyPartState;
|
||||
|
||||
typedef enum {
|
||||
DtMailCheckUnknown = 0,
|
||||
DtMailCheckGood = 1,
|
||||
DtMailCheckBad = 2
|
||||
} DtMailChecksumState;
|
||||
|
||||
typedef enum {
|
||||
DtMailBusyState_NotBusy = 0,
|
||||
DtMailBusyState_AutoSave = 1,
|
||||
DtMailBusyState_NewMail = 2
|
||||
} DtMailBusyState;
|
||||
|
||||
typedef enum {
|
||||
DtMailFileObject = 1,
|
||||
DtMailBufferObject = 2,
|
||||
DtMailReservedObject = 8192
|
||||
} DtMailObjectSpace;
|
||||
|
||||
typedef struct {
|
||||
void * buffer;
|
||||
unsigned long size;
|
||||
} DtMailBuffer;
|
||||
|
||||
/* The event packet is written to the event file descriptor.
|
||||
* This structure is only useful to programs dealing directly with
|
||||
* the DtMail library events.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
DTM_TARGET_MAILBOX,
|
||||
DTM_TARGET_TRANSPORT
|
||||
} DtMailCallbackTarget;
|
||||
|
||||
typedef struct {
|
||||
DtMailObjectKey key;
|
||||
DtMailCallbackTarget target;
|
||||
void * target_object;
|
||||
void * operation;
|
||||
void * argument;
|
||||
time_t event_time;
|
||||
} DtMailEventPacket;
|
||||
|
||||
typedef enum {
|
||||
DtMailLockRead = 1,
|
||||
DtMailLockWrite = 2
|
||||
} DtMailLock;
|
||||
|
||||
#endif
|
||||
103
cde/programs/dtmail/include/DtMail/DtMailValues.hh
Normal file
103
cde/programs/dtmail/include/DtMail/DtMailValues.hh
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $TOG: DtMailValues.hh /main/7 1997/09/03 17:27:15 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreementbertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTMAILVALUE_HH
|
||||
#define _DTMAILVALUE_HH
|
||||
|
||||
#include <DtMail/DtVirtArray.hh>
|
||||
|
||||
// Dates consist of a date, and an offset from GMT.
|
||||
//
|
||||
#include <time.h>
|
||||
|
||||
struct DtMailValueDate : public DtCPlusPlusAllocator {
|
||||
time_t dtm_date;
|
||||
time_t dtm_tz_offset_secs;
|
||||
};
|
||||
|
||||
// An address consists of 3 components. The addressee is the string that
|
||||
// is used by the transport to deliver the mail to the user. The person
|
||||
// is the string that represents this person in the real world (e.g. Bob Patterson).
|
||||
// The namespace is used to identify which address space the name belongs to.
|
||||
// This can be set to DtMailAddressDefault to specify the library should figure
|
||||
// out the appropriate name space.
|
||||
//
|
||||
|
||||
#define DtMailAddressDefault "Dt:Mail:Address:Default"
|
||||
|
||||
struct DtMailValueAddress : public DtCPlusPlusAllocator {
|
||||
char *dtm_address;
|
||||
char *dtm_person;
|
||||
char *dtm_namespace;
|
||||
|
||||
DtMailValueAddress(void);
|
||||
DtMailValueAddress(const DtMailValueAddress &);
|
||||
DtMailValueAddress(const char * address,
|
||||
const char * person,
|
||||
const char * nameSpace);
|
||||
|
||||
DtMailValueAddress(const char * address, const int addr_len,
|
||||
const char * person, const int per_len,
|
||||
const char * nameSpace);
|
||||
~DtMailValueAddress(void);
|
||||
};
|
||||
|
||||
class DtMailAddressSeq : public DtVirtArray<DtMailValueAddress *> {
|
||||
public:
|
||||
DtMailAddressSeq(int size = 8);
|
||||
~DtMailAddressSeq(void);
|
||||
};
|
||||
|
||||
class DtMailValue : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
DtMailValue(const char * value);
|
||||
virtual ~DtMailValue(void);
|
||||
|
||||
virtual operator const char *(void);
|
||||
|
||||
virtual const char * operator= (const char *);
|
||||
|
||||
virtual DtMailValueDate toDate(void);
|
||||
#ifdef DEAD_WOOD
|
||||
virtual void fromDate(const DtMailValueDate &);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
virtual DtMailAddressSeq * toAddress(void);
|
||||
#ifdef DEAD_WOOD
|
||||
virtual void fromAddress(const DtMailAddressSeq & list);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
// This method gives the raw format used to store the value.
|
||||
//
|
||||
virtual const char * raw(void);
|
||||
|
||||
protected:
|
||||
char * _value;
|
||||
};
|
||||
|
||||
class DtMailValueSeq : public DtVirtArray<DtMailValue *> {
|
||||
public:
|
||||
DtMailValueSeq(int size = 8);
|
||||
~DtMailValueSeq(void);
|
||||
|
||||
void clear(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
39
cde/programs/dtmail/include/DtMail/DtMailXtProc.h
Normal file
39
cde/programs/dtmail/include/DtMail/DtMailXtProc.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $XConsortium: DtMailXtProc.h /main/4 1996/04/21 19:45:02 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DTMAILXTPROC_H
|
||||
#define _DTMAILXTPROC_H
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void DtMailXtInputProc(XtPointer, int *, XtInputId *);
|
||||
|
||||
extern XtAppContext DtMailDamageContext;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
72
cde/programs/dtmail/include/DtMail/DtVirtArray.hh
Normal file
72
cde/programs/dtmail/include/DtMail/DtVirtArray.hh
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $TOG: DtVirtArray.hh /main/5 1997/12/23 09:08:16 bill $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _VIRTARRAY_HH
|
||||
#define _VIRTARRAY_HH
|
||||
|
||||
#include <DtMail/DtLanguages.hh>
|
||||
|
||||
class DtVirtArrayImpl : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
DtVirtArrayImpl(const int size);
|
||||
~DtVirtArrayImpl(void);
|
||||
|
||||
int length(void);
|
||||
void * operator[](const int at);
|
||||
|
||||
int indexof(void * handle);
|
||||
int append(void * handle);
|
||||
void insert(void * handle, const int at);
|
||||
void remove(const int at);
|
||||
void remove(void * handle);
|
||||
|
||||
private:
|
||||
void make_slot(const int at);
|
||||
void grow(void);
|
||||
|
||||
void **_elements;
|
||||
int _size;
|
||||
int _count;
|
||||
|
||||
void *_mutex;
|
||||
};
|
||||
|
||||
template <class Element>
|
||||
class DtVirtArray : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
DtVirtArray(const int size)
|
||||
: my_array(size) {}
|
||||
|
||||
~DtVirtArray(void) {}
|
||||
|
||||
int length(void) { return(my_array.length()); }
|
||||
|
||||
Element operator[](const int at) { return((Element)my_array[at]); }
|
||||
int indexof(Element handle) { return(my_array.indexof((void *)handle)); }
|
||||
int append(Element handle) { return(my_array.append((void *)handle)); }
|
||||
void insert(Element handle, const int at) { my_array.insert((void *)handle, at); }
|
||||
void remove(const int at) { my_array.remove(at); }
|
||||
void remove(Element handle) { my_array.remove((void *)handle); }
|
||||
|
||||
private:
|
||||
DtVirtArrayImpl my_array;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,56 @@
|
||||
/* $TOG: EncryptedTextFieldUiItem.hh /main/1 1997/11/07 15:44:39 mgreess $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _ENCRYPTEDTEXTFIELDUIITEM_HH
|
||||
#define _ENCRYPTEDTEXTFIELDUIITEM_HH
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#include <DtMail/DtMailTypes.h>
|
||||
|
||||
// derived class for prop sheet glue items for textfield
|
||||
////////////////////////////////////////////////////////
|
||||
class EncryptedTextFieldUiItem : public PropUiItem {
|
||||
|
||||
public:
|
||||
EncryptedTextFieldUiItem(
|
||||
Widget w,
|
||||
int source,
|
||||
char *search_key,
|
||||
PropUiCallback validator = NULL,
|
||||
void * validator_data = NULL);
|
||||
virtual ~EncryptedTextFieldUiItem() {if (NULL!=_text) free(_text);};
|
||||
|
||||
void writeAllowed(DtMailBoolean);
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
|
||||
private:
|
||||
DtMailBoolean _loading;
|
||||
int _maxtextlen;
|
||||
char *_text;
|
||||
DtMailBoolean _writeAllowed;
|
||||
|
||||
void validateLength(int);
|
||||
void verify(XmTextVerifyPtr);
|
||||
static void verifyCB(Widget, XtPointer, XtPointer);
|
||||
};
|
||||
|
||||
#endif
|
||||
89
cde/programs/dtmail/include/DtMail/FileShare.hh
Normal file
89
cde/programs/dtmail/include/DtMail/FileShare.hh
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $TOG: FileShare.hh /main/5 1997/04/29 16:45:06 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _FILESHARE_HH
|
||||
#define _FILESHARE_HH
|
||||
|
||||
#include <DtMail/DtMail.hh>
|
||||
#include <Tt/tt_c.h>
|
||||
|
||||
class FileShare : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
FileShare(DtMailEnv & error,
|
||||
DtMail::Session * session,
|
||||
const char * path,
|
||||
DtMailCallback cb_func,
|
||||
void * clientData);
|
||||
virtual ~FileShare(void);
|
||||
|
||||
void lockFile(DtMailEnv & error);
|
||||
DtMailBoolean readOnly(DtMailEnv & error);
|
||||
DtMailBoolean readWriteOverride(DtMailEnv & error);
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
DtMailBoolean locked(void);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
private:
|
||||
struct TTHandle : public DtCPlusPlusAllocator {
|
||||
DtMail::Session *session;
|
||||
DtMailObjectKey key;
|
||||
FileShare * self;
|
||||
};
|
||||
|
||||
DtMailObjectKey _key;
|
||||
DtMail::Session *_session;
|
||||
char *_path;
|
||||
TTHandle *_tt_handle;
|
||||
Tt_pattern *_file_pats;
|
||||
DtMailBoolean _have_write_access;
|
||||
DtMailBoolean _other_modified;
|
||||
DtMailCallback _cb_func;
|
||||
void *_cb_data;
|
||||
|
||||
enum PendingOp {
|
||||
PENDING_LOCK = 1,
|
||||
PENDING_SAVE = 2,
|
||||
PENDING_DESTROY = 3
|
||||
};
|
||||
|
||||
PendingOp _pending;
|
||||
DtMailBoolean _outstanding;
|
||||
|
||||
DtMailBoolean isModified(DtMailEnv & error);
|
||||
|
||||
static Tt_message fileCB(Tt_message msg, Tttk_op op,
|
||||
char * path, void *clientData, int same_euid,
|
||||
int same_proc);
|
||||
|
||||
static Tt_callback_action mt_lock_cb(Tt_message m, Tt_pattern p);
|
||||
|
||||
static Tt_message fileRequestCB(Tt_message, Tttk_op,
|
||||
char *, void *, int, int);
|
||||
|
||||
/* _mt_pattern is used to handle tlock and rulock messages from mailtool */
|
||||
Tt_pattern _mt_pattern;
|
||||
|
||||
/* _mt_lock is DTM_TRUE is we use the mailtool locking protocol */
|
||||
int _mt_lock;
|
||||
};
|
||||
|
||||
#endif
|
||||
83
cde/programs/dtmail/include/DtMail/HashTable.hh
Normal file
83
cde/programs/dtmail/include/DtMail/HashTable.hh
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $XConsortium: HashTable.hh /main/4 1996/04/21 19:45:12 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _HASHTABLE_HH
|
||||
#define _HASHTABLE_HH
|
||||
|
||||
#include <DtMail/ObjectKey.hh>
|
||||
|
||||
class HashTableImpl : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
HashTableImpl(int table_size);
|
||||
virtual ~HashTableImpl(void);
|
||||
|
||||
virtual void * lookup(ObjectKey &);
|
||||
virtual void set(ObjectKey & key, void * value);
|
||||
virtual void * remove(ObjectKey & key);
|
||||
|
||||
// HP can not support this construct.
|
||||
// UXP/DS can not support this construct either.
|
||||
//
|
||||
#if !defined(HPUX) && !defined(__uxp__)
|
||||
//
|
||||
#define HASHTABLE_HASFOREACH
|
||||
|
||||
typedef int (*HashImplIterator)(ObjectKey &, void * value, void * client_data);
|
||||
virtual void forEach(HashImplIterator, void * client_data);
|
||||
|
||||
#endif
|
||||
|
||||
protected:
|
||||
struct HashEntry : public DtCPlusPlusAllocator {
|
||||
ObjectKey * key;
|
||||
void * value;
|
||||
HashEntry *next;
|
||||
};
|
||||
|
||||
HashEntry * _hash_table;
|
||||
int _table_size;
|
||||
};
|
||||
|
||||
template <class Object>
|
||||
class HashTable : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
HashTable(int table_size) : _table(table_size) { }
|
||||
|
||||
Object lookup(ObjectKey & key) { return( (Object)((long)_table.lookup(key)) ); }
|
||||
|
||||
void set(ObjectKey & key, Object obj) {
|
||||
_table.set(key, (void *)obj);
|
||||
}
|
||||
|
||||
Object remove(ObjectKey & key) { return( (Object)((long)_table.remove(key)) ); }
|
||||
|
||||
#if !defined(HPUX) && !defined(__uxp__)
|
||||
typedef int (*HashIterator)(ObjectKey &, Object, void * client_data);
|
||||
void forEach(HashTableImpl::HashImplIterator iterator, void * client_data) {
|
||||
_table.forEach((HashTableImpl::HashImplIterator)iterator, client_data);
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
HashTableImpl _table;
|
||||
};
|
||||
|
||||
#endif
|
||||
104
cde/programs/dtmail/include/DtMail/IO.hh
Normal file
104
cde/programs/dtmail/include/DtMail/IO.hh
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $TOG: IO.hh /main/10 1999/01/29 14:43:20 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#ifndef _IO_HH
|
||||
#define _IO_HH
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <utime.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/uio.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <DtMail/DtMailError.hh>
|
||||
|
||||
//
|
||||
// The following I/O routines are wrappers for the normal routines,
|
||||
// but they deal with EINTR, and partial read/write situations.
|
||||
//
|
||||
int SafeAccess(const char * path, int amode);
|
||||
int SafeClose(int fd);
|
||||
int SafeDup2(int fd1, int fd2);
|
||||
int SafeExecvp(const char * file, char *const *argv);
|
||||
int SafeFchown(int fd, uid_t owner, gid_t group);
|
||||
int SafeFChmod(int fd, mode_t mode);
|
||||
int SafeFStat(int fd, struct stat * buf);
|
||||
int SafeFTruncate(int fd, off_t len);
|
||||
int SafeGuaranteedStat(const char * path, struct stat * buf);
|
||||
int SafeLStat(const char * path, struct stat * buf);
|
||||
int SafeLink(const char * existingPath, const char * newPath);
|
||||
int SafeLockf(int fd, int func, long size);
|
||||
int SafeOpen(const char * path, int oflag, mode_t mode = 0644);
|
||||
void SafePathIsAccessible(DtMailEnv &error, const char * path);
|
||||
ssize_t SafeRead(int fd, void * buf, size_t bytes);
|
||||
int SafeRename(const char * oldPath, const char * newPath);
|
||||
int SafeRemove(const char * path);
|
||||
int SafeStat(const char * path, struct stat * buf);
|
||||
int SafeTruncate(const char * path, off_t len);
|
||||
int SafeUTime(const char * path, utimbuf * ntime);
|
||||
int SafeUnlink(const char * path);
|
||||
ssize_t SafeWrite(int fd, const void * buf, size_t bytes);
|
||||
unsigned long
|
||||
SafeWritev(int fd, struct iovec *iov, int iovcnt);
|
||||
ssize_t SafeWriteStrip(int fd, const void * buf, size_t bytes);
|
||||
int SafeWaitpid(pid_t proc, int * status, int options);
|
||||
int SafeWait(int * status);
|
||||
|
||||
// The time routines deal with MT and reentrant issues in a platform
|
||||
// independent way.
|
||||
//
|
||||
void SafeCtime(const time_t *clock, char * buf, int buflen = 26);
|
||||
void SafeLocaltime(const time_t *clock, tm & result);
|
||||
time_t SafeMktime(tm * timeptr);
|
||||
size_t SafeStrftime(
|
||||
char * buf, size_t buf_size,
|
||||
const char * format, const tm * timeptr);
|
||||
|
||||
//
|
||||
// Interface routines to AF_INET, SOCK_STREAM sockets with line-based
|
||||
// buffering.
|
||||
//
|
||||
void *SockOpen(char *host, int clientPort, char **errorstring);
|
||||
char *SockGets(char *buf, int len, void *sockfp);
|
||||
int SockPrintf(void *sockfp, char *format, ...);
|
||||
int SockRead(char *buf, int size, int nels, void *sockfp);
|
||||
int SockWrite(char *buf, int size, int nels, void *sockfp);
|
||||
void SockClose(void *sockfp);
|
||||
|
||||
//
|
||||
// The group and password routines will retrieve the group and
|
||||
// password names in an MT-Safe way.
|
||||
//
|
||||
int FileSystemSpace(const char *file_path, size_t bytes, char **fsname);
|
||||
void GetGroupName(char * grp_name);
|
||||
gid_t GetIdForGroupName(char * grp_name);
|
||||
void GetPasswordEntry(passwd & result);
|
||||
int isSetMailGidNeeded(const char * mailboxPath);
|
||||
|
||||
#endif
|
||||
52
cde/programs/dtmail/include/DtMail/IgnoreListUiItem.hh
Normal file
52
cde/programs/dtmail/include/DtMail/IgnoreListUiItem.hh
Normal file
@@ -0,0 +1,52 @@
|
||||
/* $XConsortium: IgnoreListUiItem.hh /main/3 1995/11/06 16:27:06 rswiston $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifndef _IGNORELISTUIITEM_HH
|
||||
#define _IGNORELISTUIITEM_HH
|
||||
|
||||
void handleSelection(Widget, XtPointer, XtPointer );
|
||||
|
||||
// CLASS IgnoreListUiItem
|
||||
// derived class for prop sheet glue items for textfield
|
||||
///////////////////////////////////////////////////////////
|
||||
class IgnoreListUiItem : public ListUiItem {
|
||||
|
||||
public:
|
||||
IgnoreListUiItem(Widget w, int source, char *search_key, Widget w_list);
|
||||
virtual ~IgnoreListUiItem(){;}; // we don't alloc any memory
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
virtual void AddDefaults();
|
||||
Widget getEntryFieldWidget(){ return entry_field_widget;};
|
||||
DtVirtArray<PropStringPair *> *getItemList(){ return list_items; };
|
||||
|
||||
virtual void handleAddButtonPress();
|
||||
virtual void handleChangeButtonPress();
|
||||
virtual void handleDeleteButtonPress();
|
||||
|
||||
private:
|
||||
|
||||
DtVirtArray<PropStringPair *> *list_items;
|
||||
DtVirtArray<char *> *deleted_items;
|
||||
Widget entry_field_widget;
|
||||
};
|
||||
|
||||
#endif
|
||||
67
cde/programs/dtmail/include/DtMail/ImplDriver.hh
Normal file
67
cde/programs/dtmail/include/DtMail/ImplDriver.hh
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $XConsortium: ImplDriver.hh /main/4 1996/04/21 19:45:15 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _IMPLDRIVER_HH
|
||||
#define _IMPLDRIVER_HH
|
||||
|
||||
#include <DtMail/DtMail.hh>
|
||||
#include <stdarg.h>
|
||||
|
||||
static const char * QueryImplEntryOp = "QueryImplEntry";
|
||||
typedef void (*QueryImplEntry)(DtMail::Session &,
|
||||
DtMailEnv &,
|
||||
const char * capability,
|
||||
va_list args);
|
||||
|
||||
static const char * QueryOpenEntryOp = "QueryOpenEntry";
|
||||
typedef DtMailBoolean (*QueryOpenEntry)(DtMail::Session &,
|
||||
DtMailEnv &,
|
||||
DtMailObjectSpace space,
|
||||
void * arg);
|
||||
|
||||
static const char * MailBoxConstructEntryOp = "MailBoxConstructEntryOp";
|
||||
typedef DtMail::MailBox * (*MailBoxConstructEntry)(DtMail::Session &,
|
||||
DtMailEnv &,
|
||||
DtMailObjectSpace space,
|
||||
void * arg,
|
||||
DtMailCallback cb,
|
||||
void * client_data);
|
||||
|
||||
static const char * QueryMessageEntryOp = "QueryMessageEntry";
|
||||
typedef DtMailBoolean (*QueryMessageEntry)(DtMail::Session &,
|
||||
DtMailEnv &,
|
||||
DtMailObjectSpace space,
|
||||
void * arg);
|
||||
|
||||
static const char * MessageConstructEntryOp = "MessageConstructEntryOp";
|
||||
typedef DtMail::Message * (*MessageConstructEntry)(DtMail::Session &,
|
||||
DtMailEnv &,
|
||||
DtMailObjectSpace space,
|
||||
void * arg,
|
||||
DtMailCallback cb,
|
||||
void * client_data);
|
||||
|
||||
static const char * TransportConstructEntryOp = "TransportConstructEntryOp";
|
||||
typedef DtMail::Transport * (*TransportConstructEntry)(DtMail::Session &,
|
||||
DtMailEnv &,
|
||||
DtMailStatusCallback,
|
||||
void *);
|
||||
#endif
|
||||
42
cde/programs/dtmail/include/DtMail/InboxTextFieldUiItem.hh
Normal file
42
cde/programs/dtmail/include/DtMail/InboxTextFieldUiItem.hh
Normal file
@@ -0,0 +1,42 @@
|
||||
/* $TOG: InboxTextFieldUiItem.hh /main/1 1998/02/17 12:28:13 mgreess $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifndef _INBOXTEXTFIELDUIITEM_HH
|
||||
#define _INBOXTEXTFIELDUIITEM_HH
|
||||
|
||||
// derived class for prop sheet glue items for textfield
|
||||
///////////////////////////////////////////////////////////
|
||||
class InboxTextFieldUiItem : public PropUiItem
|
||||
{
|
||||
public:
|
||||
InboxTextFieldUiItem(
|
||||
Widget w,
|
||||
int source,
|
||||
char *search_key,
|
||||
PropUiCallback validator = NULL,
|
||||
void * validator_data = NULL);
|
||||
virtual ~InboxTextFieldUiItem() {;}; // we don't alloc any memory
|
||||
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1,81 @@
|
||||
/* $TOG: IndexedOptionMenuUiItem.hh /main/3 1997/11/07 15:44:49 mgreess $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
/*
|
||||
* Common Desktop Environment
|
||||
*
|
||||
* (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994, 1995 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1993, 1994, 1995 Novell, Inc.
|
||||
* (c) Copyright 1995 Digital Equipment Corp.
|
||||
* (c) Copyright 1995 Fujitsu Limited
|
||||
* (c) Copyright 1995 Hitachi, Ltd.
|
||||
*
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND
|
||||
*
|
||||
*Use, duplication, or disclosure by the U.S. Government is subject to
|
||||
*restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
|
||||
*Technical Data and Computer Software clause in DFARS 252.227-7013. Rights
|
||||
*for non-DOD U.S. Government Departments and Agencies are as set forth in
|
||||
*FAR 52.227-19(c)(1,2).
|
||||
|
||||
*Hewlett-Packard Company, 3000 Hanover Street, Palo Alto, CA 94304 U.S.A.
|
||||
*International Business Machines Corp., Route 100, Somers, NY 10589 U.S.A.
|
||||
*Sun Microsystems, Inc., 2550 Garcia Avenue, Mountain View, CA 94043 U.S.A.
|
||||
*Novell, Inc., 190 River Road, Summit, NJ 07901 U.S.A.
|
||||
*Digital Equipment Corp., 111 Powdermill Road, Maynard, MA 01754, U.S.A.
|
||||
*Fujitsu Limited, 1015, Kamikodanaka Nakahara-Ku, Kawasaki 211, Japan
|
||||
*Hitachi, Ltd., 6, Kanda Surugadai 4-Chome, Chiyoda-ku, Tokyo 101, Japan
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#include <DtMail/PropUi.hh>
|
||||
#include "IndexedOptionMenu.h"
|
||||
|
||||
#ifndef _INDEXEDOPTIONMENUUIITEM_HH
|
||||
#define _INDEXEDOPTIONMENUUIITEM_HH
|
||||
|
||||
// CLASS IndexedOptionMenuUiItem
|
||||
// derived class for prop sheet glue items for option menu
|
||||
///////////////////////////////////////////////////////////
|
||||
class IndexedOptionMenuUiItem : public PropUiItem {
|
||||
|
||||
public:
|
||||
IndexedOptionMenuUiItem(IndexedOptionMenu *iom, int source, char *search_key);
|
||||
virtual ~IndexedOptionMenuUiItem(){;}; // we don't alloc any memory
|
||||
#ifdef DEAD_WOOD
|
||||
virtual int getType(){ return _INDEXED_OPTIONMENU_ITEM; };
|
||||
virtual int getSource(){ return data_source; };
|
||||
#endif /* DEAD_WOOD */
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
|
||||
private:
|
||||
static void valueChangedCB(Widget, XtPointer, XtPointer);
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
int data_source;
|
||||
#endif /* DEAD_WOOD */
|
||||
IndexedOptionMenu *_iom;
|
||||
};
|
||||
|
||||
#endif
|
||||
52
cde/programs/dtmail/include/DtMail/ListUiItem.hh
Normal file
52
cde/programs/dtmail/include/DtMail/ListUiItem.hh
Normal file
@@ -0,0 +1,52 @@
|
||||
/* $XConsortium: ListUiItem.hh /main/4 1996/04/21 19:45:18 drk $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include "PropUi.hh"
|
||||
|
||||
#ifndef _LISTUIITEM_HH
|
||||
#define _LISTUIITEM_HH
|
||||
|
||||
// CLASS ListUiItem
|
||||
// derived class for prop sheet glue items for textfield
|
||||
///////////////////////////////////////////////////////////
|
||||
class ListUiItem : public PropUiItem {
|
||||
|
||||
public:
|
||||
ListUiItem(Widget w, int source, char *search_key, DtVirtArray<char *> *alias_list);
|
||||
virtual ~ListUiItem(){;}; // we don't alloc any memory
|
||||
#ifdef DEAD_WOOD
|
||||
virtual int getType(){ return _LIST_ITEM; };
|
||||
virtual int getSource(){ return data_source; };
|
||||
#endif /* DEAD_WOOD */
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
virtual void AddDefaults();
|
||||
|
||||
virtual void handleAddButtonPress(){;};
|
||||
virtual void handleChangeButtonPress(){;};
|
||||
virtual void handleDeleteButtonPress(){;};
|
||||
|
||||
private:
|
||||
#ifdef DEAD_WOOD
|
||||
int data_source;
|
||||
#endif /* DEAD_WOOD */
|
||||
};
|
||||
|
||||
#endif
|
||||
52
cde/programs/dtmail/include/DtMail/MoveMenuListUiItem.hh
Normal file
52
cde/programs/dtmail/include/DtMail/MoveMenuListUiItem.hh
Normal file
@@ -0,0 +1,52 @@
|
||||
/* $XConsortium: MoveMenuListUiItem.hh /main/3 1996/04/21 19:45:22 drk $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifndef _MOVEMENULISTUIITEM_HH
|
||||
#define _MOVEMENULISTUIITEM_HH
|
||||
|
||||
void handleMMSelection(Widget, XtPointer, XtPointer);
|
||||
|
||||
// CLASS MoveMenuListUiItem
|
||||
// derived class for prop sheet glue items for textfield
|
||||
///////////////////////////////////////////////////////////
|
||||
class MoveMenuListUiItem : public ListUiItem {
|
||||
|
||||
public:
|
||||
MoveMenuListUiItem(Widget w, int source, char *search_key, Widget w_list);
|
||||
virtual ~MoveMenuListUiItem(){;}; // we don't alloc any memory
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
Widget getEntryFieldWidget(){ return entry_field_widget;};
|
||||
DtVirtArray<PropStringPair *> *getItemList(){ return list_items; };
|
||||
|
||||
virtual void handleAddButtonPress();
|
||||
virtual void handleChangeButtonPress();
|
||||
virtual void handleDeleteButtonPress();
|
||||
|
||||
private:
|
||||
|
||||
DtVirtArray<PropStringPair *> *list_items;
|
||||
DtVirtArray<char *> *deleted_items;
|
||||
Widget entry_field_widget;
|
||||
};
|
||||
|
||||
#endif
|
||||
50
cde/programs/dtmail/include/DtMail/ObjectKey.hh
Normal file
50
cde/programs/dtmail/include/DtMail/ObjectKey.hh
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $XConsortium: ObjectKey.hh /main/4 1996/04/21 19:45:25 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _OBJECTKEY_HH
|
||||
#define _OBJECTKEY_HH
|
||||
|
||||
#include <DtMail/DtLanguages.hh>
|
||||
|
||||
typedef char * ObjectKeyType;
|
||||
typedef short HashVal;
|
||||
|
||||
class ObjectKey : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
ObjectKey(ObjectKeyType type);
|
||||
ObjectKey(ObjectKey &);
|
||||
virtual ~ObjectKey(void);
|
||||
|
||||
virtual int operator==(ObjectKey &) = 0;
|
||||
virtual int operator!=(ObjectKey &) = 0;
|
||||
virtual int operator<(ObjectKey &) = 0;
|
||||
virtual int operator>(ObjectKey &) = 0;
|
||||
virtual int operator<=(ObjectKey &) = 0;
|
||||
virtual int operator>=(ObjectKey &) = 0;
|
||||
|
||||
virtual HashVal hashValue(void) = 0;
|
||||
|
||||
protected:
|
||||
ObjectKeyType _type;
|
||||
HashVal genericHashValue(void * buf, int len);
|
||||
};
|
||||
|
||||
#endif
|
||||
140
cde/programs/dtmail/include/DtMail/OptCmd.h
Normal file
140
cde/programs/dtmail/include/DtMail/OptCmd.h
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $TOG: OptCmd.h /main/12 1999/07/13 08:42:43 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// OptCmd.h: Display the Mail Options dialog
|
||||
////////////////////////////////////////////////////////////
|
||||
#ifndef OPTCMD_H
|
||||
#define OPTCMD_H
|
||||
|
||||
#include "PropUi.hh"
|
||||
#include "DtVirtArray.hh"
|
||||
#include "DmxPrintOptions.h"
|
||||
#include "DtMailGenDialog.hh"
|
||||
#include "MainWindow.h"
|
||||
#include "MailRetrievalOptions.h"
|
||||
#include "WarnNoUndoCmd.h"
|
||||
#include "options_ui.h"
|
||||
|
||||
void vaca_msg_changedCB(Widget w,
|
||||
XtPointer ClientData,
|
||||
XtPointer calldata);
|
||||
void options_set_category_pane(Widget pane);
|
||||
void opt_help_button_CB(Widget wid, XtPointer clientData, XtPointer calldata);
|
||||
|
||||
|
||||
class OptCmd: public WarnNoUndoCmd {
|
||||
|
||||
protected:
|
||||
|
||||
virtual void doit(); // Call exit
|
||||
DtbOptionsDialogInfo _opt_dlog;
|
||||
|
||||
public:
|
||||
|
||||
OptCmd ( char *, char *, int, Widget parent);
|
||||
virtual ~OptCmd();
|
||||
void create_dlog();
|
||||
void unmanage();
|
||||
virtual const char *const className () { return "OptCmd"; }
|
||||
virtual void execute(); // Overrides the AskFirstCmd member function
|
||||
|
||||
void update_panes(); // sync up ui with hash tables
|
||||
void updateUiFromBackEnd(DtVirtArray<PropUiItem *> *list);
|
||||
|
||||
void update_source();
|
||||
void updateBackEndFromUi(DtVirtArray<PropUiItem *> *list);
|
||||
|
||||
int doFileLockingCheck();
|
||||
void doVacationCheck();
|
||||
void setVacationChanged();
|
||||
void set_vaca_msg_Changed();
|
||||
Boolean startVacation();
|
||||
void stopVacation();
|
||||
void help_button_CB(Widget pane);
|
||||
void setNewCategoryStr();
|
||||
void setOldCategoryStr();
|
||||
DtMailGenDialog *genDialog() { return generalDialog; }
|
||||
void setCurrentPane(Widget pane) { CurrentPane = pane; }
|
||||
Widget currentPane() { return CurrentPane; }
|
||||
|
||||
void displayAliasesOptionsPane();
|
||||
void displayPrintingOptionsPane();
|
||||
Boolean optionsAreValid();
|
||||
void displayMailRetrievalOptionsPane();
|
||||
|
||||
private:
|
||||
virtual void init_panes(); // hook up front and back ends
|
||||
|
||||
virtual void init_msg_hdr_pane();
|
||||
virtual void init_msg_view_pane();
|
||||
virtual void init_compose_pane();
|
||||
virtual void init_msg_filing_pane();
|
||||
virtual void init_vacation_pane();
|
||||
virtual void init_template_pane();
|
||||
virtual void init_aliases_pane();
|
||||
virtual void init_advanced_pane();
|
||||
virtual void init_printing_pane();
|
||||
virtual void init_mailretrieval_pane();
|
||||
|
||||
DtVirtArray<PropUiItem *> *mh_pane_list;
|
||||
DtVirtArray<PropUiItem *> *msg_view_pane_list;
|
||||
DtVirtArray<PropUiItem *> *compose_pane_list;
|
||||
DtVirtArray<PropUiItem *> *msg_filing_pane_list;
|
||||
DtVirtArray<PropUiItem *> *vacation_pane_list;
|
||||
DtVirtArray<PropUiItem *> *template_pane_list;
|
||||
DtVirtArray<PropUiItem *> *aliases_pane_list;
|
||||
DtVirtArray<PropUiItem *> *advanced_pane_list;
|
||||
DtVirtArray<PropUiItem *> *printing_pane_list;
|
||||
DtVirtArray<PropUiItem *> *mailretrieval_pane_list;
|
||||
|
||||
Boolean vacation_status_changed;
|
||||
Boolean vacation_msg_changed;
|
||||
Boolean _reopen_mailboxes;
|
||||
|
||||
XmString vaca_sub;
|
||||
XmString vaca_msg;
|
||||
XmString catstr;
|
||||
DtMailGenDialog *generalDialog;
|
||||
Widget CurrentPane;
|
||||
DmxPrintOptions *_PrintingOptions;
|
||||
MailRetrievalOptions *_MailRetrievalOptions;
|
||||
};
|
||||
#endif
|
||||
76
cde/programs/dtmail/include/DtMail/PropSource.hh
Normal file
76
cde/programs/dtmail/include/DtMail/PropSource.hh
Normal file
@@ -0,0 +1,76 @@
|
||||
/* $TOG: PropSource.hh /main/6 1997/11/13 13:26:08 mgreess $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include "DtMail.hh"
|
||||
#include <DtMail/DtMailTypes.h>
|
||||
#include <DtMail/DtVirtArray.hh>
|
||||
|
||||
#ifndef _PROPSOURCE_HH
|
||||
#define _PROPSOURCE_HH
|
||||
|
||||
struct PropDefaults {
|
||||
const char * key;
|
||||
const char * value;
|
||||
};
|
||||
|
||||
// Virtual class is base class for props data accessing funcs
|
||||
////////////////////////////////////////////////////////////////
|
||||
class PropSource
|
||||
{
|
||||
public:
|
||||
|
||||
#define PropSourceDEFAULTVALUE " "
|
||||
|
||||
PropSource(DtMail::MailRc *m_rc, char *key);
|
||||
virtual ~PropSource();
|
||||
|
||||
virtual const char *getValue(DtMailBoolean decrypt = DTM_FALSE) = 0;
|
||||
virtual void setValue(char*, DtMailBoolean encrypt=DTM_FALSE) = 0;
|
||||
|
||||
static void setDefaultValue(char *key, char *value);
|
||||
virtual const char *getDefaultValue(void);
|
||||
virtual DtMail::MailRc *getMailRc(void) { return _mail_rc; };
|
||||
|
||||
protected:
|
||||
|
||||
char *_key; // just a pointer NOT our memory
|
||||
DtMail::MailRc *_mail_rc;
|
||||
static DtVirtArray<PropDefaults*>
|
||||
*_dynamic_defaults;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Accesses the mailrc hash tables...
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
class MailRcSource : public PropSource {
|
||||
|
||||
public:
|
||||
|
||||
MailRcSource(DtMail::MailRc *m_rc, char *key) : PropSource(m_rc, key) {;};
|
||||
virtual ~MailRcSource() {;}
|
||||
|
||||
virtual const char *getValue(DtMailBoolean decrypt = DTM_FALSE);
|
||||
virtual void setValue(char *value, DtMailBoolean encrypt = DTM_TRUE);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
86
cde/programs/dtmail/include/DtMail/PropUi.hh
Normal file
86
cde/programs/dtmail/include/DtMail/PropUi.hh
Normal file
@@ -0,0 +1,86 @@
|
||||
/* $TOG: PropUi.hh /main/9 1998/02/17 13:45:35 mgreess $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include "PropSource.hh"
|
||||
|
||||
#ifndef _PROPUI_HH
|
||||
#define _PROPUI_HH
|
||||
|
||||
// This class is the 'glue' between the mail back end and the Props GUI as
|
||||
// generated by dtbuilder
|
||||
|
||||
|
||||
// defines the type of item one wishes to create
|
||||
typedef enum {
|
||||
_ANTICHECKBOX_ITEM,
|
||||
_CHECKBOX_ITEM,
|
||||
_TEXTFIELD_ITEM,
|
||||
_LIST_ITEM,
|
||||
_SPINBOX_ITEM,
|
||||
_SCALE_ITEM,
|
||||
_INDEXED_OPTIONMENU_ITEM
|
||||
} PROP_UI_ITEM_TYPE;
|
||||
|
||||
// defines the possible sources for props variables
|
||||
typedef enum {
|
||||
_FROM_MAILRC,
|
||||
_FROM_XRDB,
|
||||
_FROM_FILE
|
||||
} PROP_SOURCES;
|
||||
|
||||
// CLASS PropUiItem
|
||||
// Base class for Prop sheet item glue list elements
|
||||
///////////////////////////////////////////////////////////
|
||||
class PropUiItem {
|
||||
|
||||
public:
|
||||
typedef char* (*PropUiCallback)(PropUiItem*, void*);
|
||||
|
||||
PropUiItem(
|
||||
Widget w,
|
||||
int source,
|
||||
char *search_key,
|
||||
PropUiCallback validator = NULL,
|
||||
void * validator_data = NULL);
|
||||
virtual ~PropUiItem();
|
||||
|
||||
Widget getWidget(){ return prop_widget; };
|
||||
virtual char * uiValueIsValid();
|
||||
virtual void writeFromUiToSource() = 0;
|
||||
virtual void writeFromSourceToUi() = 0;
|
||||
Boolean getDirtyBit(){ return dirty_bit; };
|
||||
void setDirtyBit(Boolean db) { dirty_bit = db; };
|
||||
char *getKey(){ return key; };
|
||||
PropSource *getPropSource(){ return prop_source; };
|
||||
|
||||
protected:
|
||||
|
||||
Boolean dirty_bit;
|
||||
PropSource *prop_source;
|
||||
|
||||
private:
|
||||
|
||||
Widget prop_widget;
|
||||
char *key;
|
||||
PropUiCallback _uiValueValidator;
|
||||
void *_uiValueValidatorData;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
47
cde/programs/dtmail/include/DtMail/ScaleUiItem.hh
Normal file
47
cde/programs/dtmail/include/DtMail/ScaleUiItem.hh
Normal file
@@ -0,0 +1,47 @@
|
||||
/* $XConsortium: ScaleUiItem.hh /main/4 1996/04/21 19:45:38 drk $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifndef _SCALEUIITEM_HH
|
||||
#define _SCALEUIITEM_HH
|
||||
|
||||
// CLASS ScaleUiItem
|
||||
// derived class for prop sheet glue items for scale items
|
||||
///////////////////////////////////////////////////////////
|
||||
class ScaleUiItem : public PropUiItem {
|
||||
|
||||
public:
|
||||
ScaleUiItem(Widget w, int source, char *search_key);
|
||||
virtual ~ScaleUiItem(){;}; // we don't alloc any memory
|
||||
#ifdef DEAD_WOOD
|
||||
virtual int getType(){ return _SCALE_ITEM; };
|
||||
virtual int getSource(){ return data_source; };
|
||||
#endif /* DEAD_WOOD */
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
|
||||
private:
|
||||
#ifdef DEAD_WOOD
|
||||
int data_source;
|
||||
#endif /* DEAD_WOOD */
|
||||
};
|
||||
|
||||
#endif
|
||||
47
cde/programs/dtmail/include/DtMail/SpinBoxUiItem.hh
Normal file
47
cde/programs/dtmail/include/DtMail/SpinBoxUiItem.hh
Normal file
@@ -0,0 +1,47 @@
|
||||
/* $XConsortium: SpinBoxUiItem.hh /main/4 1996/04/21 19:45:42 drk $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifndef _SPINBOXUIITEM_HH
|
||||
#define _SPINBOXUIITEM_HH
|
||||
|
||||
// CLASS SpinBoxUiItem
|
||||
// derived class for prop sheet glue items for SpinBox
|
||||
///////////////////////////////////////////////////////////
|
||||
class SpinBoxUiItem : public PropUiItem {
|
||||
|
||||
public:
|
||||
SpinBoxUiItem(Widget w, int source, char *search_key);
|
||||
virtual ~SpinBoxUiItem(){;}; // we don't alloc any memory
|
||||
#ifdef DEAD_WOOD
|
||||
virtual int getType(){ return _SPINBOX_ITEM; };
|
||||
virtual int getSource(){ return data_source; };
|
||||
#endif /* DEAD_WOOD */
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
|
||||
private:
|
||||
#ifdef DEAD_WOOD
|
||||
int data_source;
|
||||
#endif /* DEAD_WOOD */
|
||||
};
|
||||
|
||||
#endif
|
||||
56
cde/programs/dtmail/include/DtMail/TemplateListUiItem.hh
Normal file
56
cde/programs/dtmail/include/DtMail/TemplateListUiItem.hh
Normal file
@@ -0,0 +1,56 @@
|
||||
/* $XConsortium: TemplateListUiItem.hh /main/4 1996/04/21 19:45:44 drk $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifndef _TEMPLATESLISTUIITEM_HH
|
||||
#define _TEMPLATESLISTUIITEM_HH
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
extern void handleDoubleSelection(Widget w, XtPointer clientdata, XtPointer calldata);
|
||||
#endif /* DEAD_WOOD */
|
||||
// CLASS TemplateListUiItem
|
||||
// derived class for prop sheet glue items for textfield
|
||||
///////////////////////////////////////////////////////////
|
||||
class TemplateListUiItem : public ListUiItem {
|
||||
|
||||
public:
|
||||
TemplateListUiItem(Widget w, int source, char *search_key, Widget w_k, Widget w_v);
|
||||
virtual ~TemplateListUiItem(){;}; // we don't alloc any memory
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
Widget getKeyWidget(){ return key_widget;};
|
||||
Widget getValueWidget(){ return value_widget;};
|
||||
DtVirtArray<PropStringPair *> *getItemList(){ return list_items; };
|
||||
|
||||
virtual void handleAddButtonPress();
|
||||
virtual void handleChangeButtonPress();
|
||||
virtual void handleDeleteButtonPress();
|
||||
|
||||
private:
|
||||
|
||||
DtVirtArray<PropStringPair *> *list_items;
|
||||
DtVirtArray<char *> *deleted_items;
|
||||
|
||||
Widget key_widget;
|
||||
Widget value_widget;
|
||||
};
|
||||
|
||||
#endif
|
||||
42
cde/programs/dtmail/include/DtMail/TextFieldUiItem.hh
Normal file
42
cde/programs/dtmail/include/DtMail/TextFieldUiItem.hh
Normal file
@@ -0,0 +1,42 @@
|
||||
/* $TOG: TextFieldUiItem.hh /main/6 1997/11/07 15:45:26 mgreess $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifndef _TEXTFIELDUIITEM_HH
|
||||
#define _TEXTFIELDUIITEM_HH
|
||||
|
||||
// derived class for prop sheet glue items for textfield
|
||||
///////////////////////////////////////////////////////////
|
||||
class TextFieldUiItem : public PropUiItem
|
||||
{
|
||||
public:
|
||||
TextFieldUiItem(
|
||||
Widget w,
|
||||
int source,
|
||||
char *search_key,
|
||||
PropUiCallback validator = NULL,
|
||||
void * validator_data = NULL);
|
||||
virtual ~TextFieldUiItem() {;}; // we don't alloc any memory
|
||||
|
||||
virtual void writeFromUiToSource();
|
||||
virtual void writeFromSourceToUi();
|
||||
};
|
||||
#endif
|
||||
155
cde/programs/dtmail/include/DtMail/Threads.hh
Normal file
155
cde/programs/dtmail/include/DtMail/Threads.hh
Normal file
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
*
|
||||
* $TOG: Threads.hh /main/5 1997/09/03 17:27:34 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _THREADS_HH
|
||||
#define _THREADS_HH
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <DtMail/DtLanguages.hh>
|
||||
|
||||
// This mutex must be used before calling any Dt* functions. They
|
||||
// are extremely MT-UNSAFE and must be protected.
|
||||
//
|
||||
extern void * _DtMutex;
|
||||
|
||||
// This function will create an initialized mutex.
|
||||
//
|
||||
void * MutexInit(void);
|
||||
void MutexDestroy(void * mutex);
|
||||
|
||||
// This class locks the specified mutex when constructed, and
|
||||
// releases the lock on destruction. It is useful for mutexing
|
||||
// a region of code automatically by including it in the scope
|
||||
// of a set of braces.
|
||||
//
|
||||
class MutexLock : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
MutexLock(void * mutex);
|
||||
~MutexLock(void);
|
||||
|
||||
void unlock(void);
|
||||
void unlock_and_destroy(void);
|
||||
private:
|
||||
void * _mutex;
|
||||
int _locked;
|
||||
};
|
||||
|
||||
// The SafeScalar class is designed to allow safe access to scalar values
|
||||
// from within an MT app. It should only be used with the common 32 bit
|
||||
// integral values.
|
||||
//
|
||||
class SafeScalarImpl : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
SafeScalarImpl(void);
|
||||
~SafeScalarImpl(void);
|
||||
|
||||
long operator = (const long);
|
||||
long operator += (const long);
|
||||
long operator -= (const long);
|
||||
long operator *= (const long);
|
||||
long operator /= (const long);
|
||||
|
||||
int operator == (const long);
|
||||
int operator <= (const long);
|
||||
int operator < (const long);
|
||||
int operator >= (const long);
|
||||
int operator > (const long);
|
||||
int operator != (const long);
|
||||
|
||||
operator long(void);
|
||||
|
||||
private:
|
||||
void * _mutex;
|
||||
long _value;
|
||||
};
|
||||
|
||||
template <class Scalar>
|
||||
class SafeScalar : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
SafeScalar(void) : _scalar() { }
|
||||
~SafeScalar(void) { }
|
||||
|
||||
Scalar operator= (const Scalar val) { return((Scalar)(long)(_scalar = (long)val)); }
|
||||
Scalar operator += (const Scalar val) { return((Scalar)(long)(_scalar += (long)val)); }
|
||||
Scalar operator -= (const Scalar val) { return((Scalar)(long)(_scalar -= (long)val)); }
|
||||
Scalar operator *= (const Scalar val) { return((Scalar)(long)(_scalar *= (long)val)); }
|
||||
Scalar operator /= (const Scalar val) { return((Scalar)(long)(_scalar /= (long)val)); }
|
||||
|
||||
int operator == (const Scalar val) { return(_scalar == (long)val); }
|
||||
int operator <= (const Scalar val) { return(_scalar <= (long)val); }
|
||||
int operator < (const Scalar val) { return(_scalar < (long)val); }
|
||||
int operator >= (const Scalar val) { return(_scalar >= (long)val); }
|
||||
int operator > (const Scalar val) { return(_scalar > (long)val); }
|
||||
int operator != (const Scalar val) { return(_scalar != (long)val); }
|
||||
|
||||
operator Scalar (void) { return((Scalar)(long)_scalar); }
|
||||
|
||||
private:
|
||||
SafeScalarImpl _scalar;
|
||||
};
|
||||
|
||||
// The condition class is used to block an appliction until the
|
||||
// condition has changed. This is typically used while creating or
|
||||
// destroying a class.
|
||||
//
|
||||
class Condition : public DtCPlusPlusAllocator {
|
||||
public:
|
||||
Condition(void);
|
||||
~Condition(void);
|
||||
|
||||
void setTrue(void);
|
||||
void setFalse(void);
|
||||
|
||||
int state(void);
|
||||
int operator=(int);
|
||||
operator += (int);
|
||||
operator int(void);
|
||||
|
||||
void wait(void);
|
||||
|
||||
void waitTrue(void);
|
||||
#ifdef DEAD_WOOD
|
||||
void waitFalse(void);
|
||||
void waitFor(int);
|
||||
void waitGT(int); // wait >
|
||||
void waitLT(int); // wait <
|
||||
void waitProcStatus(void);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
private:
|
||||
void * _mutex;
|
||||
void * _condition;
|
||||
int _state;
|
||||
};
|
||||
|
||||
typedef unsigned int Thread;
|
||||
|
||||
typedef void * (*ThreadEntryPoint)(void *);
|
||||
|
||||
Thread ThreadCreate(ThreadEntryPoint, void * client_data);
|
||||
Thread ThreadSelf(void);
|
||||
void ThreadPrio(Thread, const int prio);
|
||||
void ThreadKill(Thread, const int signal);
|
||||
void ThreadExit(const int status);
|
||||
void ThreadJoin(Thread);
|
||||
time_t ThreadSleep(time_t seconds);
|
||||
|
||||
#endif
|
||||
120
cde/programs/dtmail/include/DtMail/options_util.h
Normal file
120
cde/programs/dtmail/include/DtMail/options_util.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/* $XConsortium: options_util.h /main/4 1996/04/21 19:45:54 drk $ */
|
||||
#ifndef _OPTIONS_UTIL_H_
|
||||
#define _OPTIONS_UTIL_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include "DtVirtArray.hh"
|
||||
#include "ListUiItem.hh"
|
||||
|
||||
void options_checkbox_init(
|
||||
Widget checkbox,
|
||||
Boolean *dirty_bit
|
||||
);
|
||||
|
||||
int options_checkbox_set_value(
|
||||
Widget checkbox,
|
||||
Boolean b_value,
|
||||
Boolean set_dirty_bit
|
||||
);
|
||||
|
||||
void options_list_init(Widget list_w, DtVirtArray<char *> *item_list);
|
||||
|
||||
Boolean options_checkbox_get_value(Widget checkbox);
|
||||
|
||||
void options_radiobox_init(Widget radiobox,
|
||||
int num_items,
|
||||
WidgetList items,
|
||||
int *item_values,
|
||||
Boolean *dirty_bit);
|
||||
|
||||
|
||||
int options_radiobox_get_value(Widget radiobox);
|
||||
|
||||
int options_radiobox_set_value(Widget radiobox,
|
||||
int value,
|
||||
Boolean set_dirty_bit);
|
||||
|
||||
/*
|
||||
* Callback: choice value has changed...turnon dirty bit
|
||||
*/
|
||||
void options_setting_chgCB(Widget widget,
|
||||
XtPointer clientdata,
|
||||
XtPointer calldata);
|
||||
|
||||
/*
|
||||
* Callback: item in exclusive choice has been set...store it's
|
||||
* value in the parent radiobox
|
||||
*/
|
||||
void options_radiobox_itemCB(Widget item,
|
||||
XtPointer clientdata,
|
||||
XtPointer calldata);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
OPTIONS_LOAD,
|
||||
OPTIONS_EDIT,
|
||||
OPTIONS_NUM_VALUES
|
||||
} OPTIONS_FIELD_STATE;
|
||||
|
||||
void options_field_init(Widget field,
|
||||
Boolean *dirty_bit);
|
||||
|
||||
String options_field_get_value(Widget field);
|
||||
|
||||
int options_field_set_value(Widget field,
|
||||
String value,
|
||||
Boolean set_dirty_bit);
|
||||
|
||||
void options_field_chgCB(Widget widget,
|
||||
XtPointer clientdata,
|
||||
XtPointer calldata);
|
||||
|
||||
void options_spinbox_init(Widget spinbox,
|
||||
Boolean *dirty_bit);
|
||||
|
||||
int options_spinbox_get_value(Widget spinbox);
|
||||
|
||||
int options_spinbox_set_value(Widget spinbox,
|
||||
int value,
|
||||
Boolean set_dirty_bit);
|
||||
|
||||
int options_scale_get_value(Widget scale);
|
||||
|
||||
int options_scale_set_value(Widget scale,
|
||||
char *value,
|
||||
Boolean set_dirty_bit);
|
||||
|
||||
void listAddButtonCB(
|
||||
Widget widget,
|
||||
XtPointer clientdata,
|
||||
XtPointer calldata);
|
||||
|
||||
void listDeleteButtonCB(
|
||||
Widget widget,
|
||||
XtPointer clientdata,
|
||||
XtPointer calldata);
|
||||
|
||||
void listChangeButtonCB(
|
||||
Widget widget,
|
||||
XtPointer clientdata,
|
||||
XtPointer calldata);
|
||||
|
||||
void add_cbs_to_list(ListUiItem *list,
|
||||
Widget add_butt,
|
||||
Widget del_butt,
|
||||
Widget chg_butt);
|
||||
/*
|
||||
** The following structs are used as the glue to stick together
|
||||
** the props dialog and the back end.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
SPINBOX_ITEM,
|
||||
CHECKBOX_ITEM,
|
||||
TEXTFIELD_ITEM,
|
||||
LIST_ITEM,
|
||||
SCALE_ITEM
|
||||
} PROP_ITEM_TYPE;
|
||||
|
||||
#endif
|
||||
142
cde/programs/dtmail/include/MotifApp/Application.h
Normal file
142
cde/programs/dtmail/include/MotifApp/Application.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/* $TOG: Application.h /main/9 1997/09/05 14:40:30 mgreess $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Application.h:
|
||||
////////////////////////////////////////////////////////////
|
||||
#ifndef APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
|
||||
#include "UIComponent.h"
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
class Application : public UIComponent {
|
||||
|
||||
// Allow main and MainWindow to access protected member functions
|
||||
friend int main ( int, char ** );
|
||||
friend class MainWindow;
|
||||
|
||||
private:
|
||||
|
||||
// Functions for registering and unregistering toplevel windows
|
||||
void registerWindow ( MainWindow * );
|
||||
void unregisterWindow ( MainWindow * );
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
// Functions to handle Xt interface
|
||||
virtual void initialize ( int *, char ** );
|
||||
virtual void handleEvents();
|
||||
|
||||
virtual void open_catalog();
|
||||
inline void extractAndRememberEventTime( XEvent * );
|
||||
|
||||
char *_applicationClass;
|
||||
XtAppContext _appContext;
|
||||
static XtResource
|
||||
_appResources[];
|
||||
char *_appWorkspaceList;
|
||||
int _bMenuButton;
|
||||
Display *_display;
|
||||
|
||||
long _lastInteractiveEventTime;
|
||||
gid_t _originalEgid; // startup effective gid
|
||||
gid_t _originalRgid; // startup real gid
|
||||
int _shutdownEnabled;
|
||||
MainWindow **_windows; // top-level windows in the program
|
||||
int _numWindows;
|
||||
|
||||
public:
|
||||
|
||||
Application ( char * );
|
||||
virtual ~Application();
|
||||
|
||||
// Functions to control session management.
|
||||
virtual int smpSaveSessionGlobal() = 0;
|
||||
virtual void smpSaveSessionLocal() = 0;
|
||||
virtual void restoreSession() = 0;
|
||||
|
||||
// Functions to control shutdown.
|
||||
void disableShutdown() { _shutdownEnabled = 0; }
|
||||
void enableShutdown() { _shutdownEnabled = 1; }
|
||||
int isEnabledShutdown() { return _shutdownEnabled; }
|
||||
virtual void shutdown() = 0;
|
||||
|
||||
// Functions to manipulate group execution privileges
|
||||
void disableGroupPrivileges(void) { (void) setgid(_originalRgid); }
|
||||
void enableGroupPrivileges(void) { (void) setgid(_originalEgid); }
|
||||
gid_t originalEgid(void) { return _originalEgid; }
|
||||
gid_t originalRgid(void) { return _originalRgid; }
|
||||
|
||||
// Functions to manipulate application's top-level windows
|
||||
void iconify();
|
||||
void manage();
|
||||
void unmanage();
|
||||
|
||||
// Convenient access functions
|
||||
virtual const char *const
|
||||
className() { return "Application"; }
|
||||
Display *display() { return _display; }
|
||||
XtAppContext appContext() { return _appContext; }
|
||||
const char *applicationClass() { return _applicationClass; }
|
||||
int bMenuButton() { return _bMenuButton; }
|
||||
char *getAppWorkspaceList() { return _appWorkspaceList; }
|
||||
long lastInteractiveEventTime(void)
|
||||
{ return _lastInteractiveEventTime; }
|
||||
int num_windows() { return _numWindows; }
|
||||
void setAppWorkspaceList(char *workspaceList);
|
||||
};
|
||||
|
||||
// Pointer to single global instance
|
||||
|
||||
extern Application *theApplication;
|
||||
|
||||
|
||||
#endif
|
||||
89
cde/programs/dtmail/include/MotifApp/AskFirstCmd.h
Normal file
89
cde/programs/dtmail/include/MotifApp/AskFirstCmd.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: AskFirstCmd.h /main/3 1995/11/06 16:29:53 rswiston $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// AskFirstCmd.h: Base class for Cmds that ask for confirmation
|
||||
////////////////////////////////////////////////////////////////
|
||||
#ifndef ASKFIRSTCMD_H
|
||||
#define ASKFIRSTCMD_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include "Cmd.h"
|
||||
#include "DialogManager.h"
|
||||
|
||||
class AskFirstCmd : public Cmd {
|
||||
|
||||
private:
|
||||
|
||||
// Callback for the yes choice on the dialog
|
||||
|
||||
static void yesCallback ( void * );
|
||||
static void cancelCallback ( void *clientData );
|
||||
|
||||
// Derived classes should use setQuestion to change
|
||||
// the string displayed in the dialog
|
||||
|
||||
char *_question;
|
||||
DialogManager *_dialog;
|
||||
|
||||
#ifndef CPLUSPLUS2_1
|
||||
protected:
|
||||
|
||||
Widget _dialogParentWidget;
|
||||
|
||||
virtual void doit() = 0; // Specific actions must be defined
|
||||
virtual void undoit() = 0; // Specific actions must be defined
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
AskFirstCmd ( char *, char *, int );
|
||||
|
||||
void setQuestion ( char *str );
|
||||
|
||||
virtual void execute(); // Overrides the Cmd member function
|
||||
|
||||
virtual void doYesCallback();
|
||||
|
||||
virtual const char *const className () { return "AskFirstCmd"; }
|
||||
};
|
||||
#endif
|
||||
72
cde/programs/dtmail/include/MotifApp/BasicComponent.h
Normal file
72
cde/programs/dtmail/include/MotifApp/BasicComponent.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: BasicComponent.h /main/4 1996/04/05 16:52:18 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// BasicComponent.h: First version of a class to define
|
||||
// a protocol for all components
|
||||
///////////////////////////////////////////////////////////////
|
||||
#ifndef BASICCOMPONENT_H
|
||||
#define BASICCOMPONENT_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
class BasicComponent {
|
||||
|
||||
protected:
|
||||
|
||||
char *_name;
|
||||
Widget _w;
|
||||
|
||||
// Protected constructor to prevent instantiation
|
||||
|
||||
BasicComponent ( const char * );
|
||||
|
||||
public:
|
||||
|
||||
virtual ~BasicComponent();
|
||||
virtual void manage(); // Manage and unmanage widget tree
|
||||
virtual void unmanage();
|
||||
const Widget baseWidget() { return _w; }
|
||||
};
|
||||
#endif
|
||||
|
||||
70
cde/programs/dtmail/include/MotifApp/BusyPixmap.h
Normal file
70
cde/programs/dtmail/include/MotifApp/BusyPixmap.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/* $XConsortium: BusyPixmap.h /main/4 1996/04/21 19:46:00 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
// BusyPixmap.h
|
||||
///////////////////////////////////////////////////
|
||||
#ifndef BUSYPIXMAP_H
|
||||
#define BUSYPIXMAP_H
|
||||
|
||||
#include "PixmapCycler.h"
|
||||
|
||||
class BusyPixmap : public PixmapCycler {
|
||||
|
||||
protected:
|
||||
|
||||
GC _gc, _inverseGC; // Used to draw Pixmaps
|
||||
Widget _w; // Widget whose colors are to be used
|
||||
void createPixmaps(); // Overrides base class pure virtual
|
||||
virtual Pixmap createBusyPixmap ( int, int );
|
||||
|
||||
public:
|
||||
|
||||
BusyPixmap ( Widget );
|
||||
};
|
||||
#endif
|
||||
68
cde/programs/dtmail/include/MotifApp/ButtonInterface.h
Normal file
68
cde/programs/dtmail/include/MotifApp/ButtonInterface.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* $XConsortium: ButtonInterface.h /main/4 1996/04/21 19:46:03 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// ButtonInterface.h: A push button interface to a Cmd object
|
||||
///////////////////////////////////////////////////////////////
|
||||
#ifndef BUTTONINTERFACE
|
||||
#define BUTTONINTERFACE
|
||||
|
||||
#include "CmdInterface.h"
|
||||
|
||||
class ButtonInterface : public CmdInterface {
|
||||
|
||||
public:
|
||||
|
||||
ButtonInterface ( Widget, Cmd * );
|
||||
#ifndef CAN_INLINE_VIRTUALS
|
||||
~ButtonInterface ( void );
|
||||
#endif /* CAN_INLINE_VIRTUALS */
|
||||
|
||||
static void mapName(const char * input, char * output);
|
||||
};
|
||||
#endif
|
||||
120
cde/programs/dtmail/include/MotifApp/Cmd.h
Normal file
120
cde/programs/dtmail/include/MotifApp/Cmd.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: Cmd.h /main/5 1996/08/30 17:03:17 drk $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
// Cmd.h: A base class for all command objects
|
||||
/////////////////////////////////////////////////////////
|
||||
#ifndef CMD_H
|
||||
#define CMD_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
class CmdList;
|
||||
class CmdInterface;
|
||||
|
||||
class Cmd {
|
||||
|
||||
friend class CmdInterface;
|
||||
|
||||
private:
|
||||
|
||||
// Lists of other commands to be activated or deactivated
|
||||
// when this command is executed or "undone"
|
||||
|
||||
CmdList *_activationList;
|
||||
CmdList *_deactivationList;
|
||||
void revert(); // Reverts object to previous state
|
||||
int _active; // Is this command currently active?
|
||||
int _previouslyActive; // Previous value of _active
|
||||
char *_name; // Name of this Cmd
|
||||
char *_label; // Label for the widget associated with Cmd.
|
||||
|
||||
protected:
|
||||
|
||||
int _hasUndo; // True if this object supports undo
|
||||
static Cmd *_lastCmd; // Pointer to last Cmd executed
|
||||
CmdInterface **_ci;
|
||||
int _numInterfaces;
|
||||
|
||||
virtual void doit() = 0; // Specific actions must be defined
|
||||
virtual void undoit() = 0; // by derived classes
|
||||
|
||||
|
||||
public:
|
||||
|
||||
Cmd ( char *, char *, int ); // Protected constructor
|
||||
|
||||
virtual ~Cmd (); // Destructor
|
||||
|
||||
// public interface for executing and undoing commands
|
||||
|
||||
virtual void execute();
|
||||
void undo();
|
||||
|
||||
void activate(); // Activate this object
|
||||
void deactivate(); // Deactivate this object
|
||||
char *getLabel() { return _label; }
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
// Functions to register dependent commands
|
||||
|
||||
void addToActivationList ( Cmd * );
|
||||
void addToDeactivationList ( Cmd * );
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
// Register an UIComponent used to execute this command
|
||||
|
||||
void registerInterface ( CmdInterface * );
|
||||
|
||||
// Access functions
|
||||
|
||||
int active () { return _active; }
|
||||
int hasUndo() { return _hasUndo; }
|
||||
const char *const name () { return _name; }
|
||||
|
||||
#ifdef CAN_INLINE_VIRTUALS
|
||||
virtual const char *const className () { return "Cmd"; }
|
||||
#else /* ! CAN_INLINE_VIRTUALS */
|
||||
virtual const char *const className ();
|
||||
#endif /* ! CAN_INLINE_VIRTUALS */
|
||||
};
|
||||
#endif
|
||||
78
cde/programs/dtmail/include/MotifApp/CmdInterface.h
Normal file
78
cde/programs/dtmail/include/MotifApp/CmdInterface.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/* $XConsortium: CmdInterface.h /main/5 1996/08/30 17:03:37 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
// CmdInterface.h
|
||||
///////////////////////////////////////////////////////
|
||||
#ifndef CMDINTERFACE
|
||||
#define CMDINTERFACE
|
||||
|
||||
#include "UIComponent.h"
|
||||
|
||||
class Cmd;
|
||||
|
||||
class CmdInterface : public UIComponent {
|
||||
|
||||
friend class Cmd;
|
||||
|
||||
protected:
|
||||
|
||||
Cmd *_cmd;
|
||||
|
||||
static void executeCmdCallback ( Widget,
|
||||
XtPointer,
|
||||
XtPointer );
|
||||
|
||||
int _active;
|
||||
|
||||
CmdInterface ( Cmd * );
|
||||
|
||||
virtual void activate();
|
||||
virtual void deactivate();
|
||||
};
|
||||
#endif
|
||||
87
cde/programs/dtmail/include/MotifApp/CmdList.h
Normal file
87
cde/programs/dtmail/include/MotifApp/CmdList.h
Normal file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: CmdList.h /main/3 1995/11/06 16:30:40 rswiston $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef CMDLIST_H
|
||||
#define CMDLIST_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// CmdList.h: Maintain a list of Cmd objects
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// MODIFIED TO INHERIT FROM CMD - not described in Book
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include "Cmd.h"
|
||||
|
||||
class CmdList : public Cmd {
|
||||
|
||||
private:
|
||||
|
||||
Cmd **_contents; // The list of objects
|
||||
int _numElements; // Current size of list
|
||||
Widget _pane;
|
||||
|
||||
virtual void doit();
|
||||
virtual void undoit();
|
||||
|
||||
public:
|
||||
|
||||
CmdList();
|
||||
CmdList(char *, char *); // Construct an empty list
|
||||
virtual ~CmdList(); // Destroys list, but not objects in list
|
||||
|
||||
void add ( Cmd * ); // Add a single Cmd object to list
|
||||
|
||||
void setPaneWidget(Widget pane) { _pane = pane; }
|
||||
Widget getPaneWidget(void) { return _pane; }
|
||||
|
||||
Cmd **contents() { return _contents; } // Return the list
|
||||
int size() { return _numElements; } // Return list size
|
||||
Cmd *operator[]( int ); // Return an element of the list
|
||||
virtual const char *const className () { return "CmdList"; }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
71
cde/programs/dtmail/include/MotifApp/ColorView.h
Normal file
71
cde/programs/dtmail/include/MotifApp/ColorView.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/* $XConsortium: ColorView.h /main/4 1996/04/21 19:46:09 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// ColorMView.h: Abstract base class. Defines protocol for
|
||||
// all views attached to the ColorModel
|
||||
/////////////////////////////////////////////////////////////
|
||||
#ifndef COLORVIEW_H
|
||||
#define COLORVIEW_H
|
||||
|
||||
#include "UIComponent.h"
|
||||
|
||||
class ColorModel;
|
||||
|
||||
class ColorView : public UIComponent {
|
||||
|
||||
protected:
|
||||
|
||||
ColorView ( char *name ) : UIComponent ( name ) { }
|
||||
|
||||
public:
|
||||
|
||||
virtual void update ( ColorModel * ) = 0;
|
||||
virtual const char *const className() { return "ColorView"; }
|
||||
};
|
||||
#endif
|
||||
91
cde/programs/dtmail/include/MotifApp/DialogCallbackData.h
Normal file
91
cde/programs/dtmail/include/MotifApp/DialogCallbackData.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/* $XConsortium: DialogCallbackData.h /main/4 1996/04/21 19:46:12 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// DialogCallbackData.h: Auxiliary class used by DialogManager
|
||||
//////////////////////////////////////////////////////////////
|
||||
#ifndef DIALOGCALLBACKDATA
|
||||
#define DIALOGCALLBACKDATA
|
||||
|
||||
class DialogManager;
|
||||
|
||||
typedef void (*DialogCallback)( void * );
|
||||
|
||||
class DialogCallbackData {
|
||||
|
||||
private:
|
||||
|
||||
DialogManager *_dialogManager;
|
||||
DialogCallback _ok;
|
||||
DialogCallback _help;
|
||||
DialogCallback _cancel;
|
||||
void *_clientData;
|
||||
|
||||
public:
|
||||
|
||||
DialogCallbackData ( DialogManager *dialog,
|
||||
void *clientData,
|
||||
DialogCallback ok,
|
||||
DialogCallback cancel,
|
||||
DialogCallback help)
|
||||
{
|
||||
_dialogManager = dialog;
|
||||
_ok = ok;
|
||||
_help = help;
|
||||
_cancel = cancel;
|
||||
_clientData = clientData;
|
||||
}
|
||||
|
||||
DialogManager *dialogManager() { return _dialogManager; }
|
||||
DialogCallback ok() { return _ok; }
|
||||
DialogCallback help() { return _help; }
|
||||
DialogCallback cancel() { return _cancel; }
|
||||
void *clientData() { return _clientData; }
|
||||
};
|
||||
#endif
|
||||
|
||||
134
cde/programs/dtmail/include/MotifApp/DialogManager.h
Normal file
134
cde/programs/dtmail/include/MotifApp/DialogManager.h
Normal file
@@ -0,0 +1,134 @@
|
||||
/* $XConsortium: DialogManager.h /main/4 1996/04/21 19:46:15 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// DialogManager.h: A base class for cached dialogs
|
||||
//////////////////////////////////////////////////////////
|
||||
#ifndef DIALOGMANAGER_H
|
||||
#define DIALOGMANAGER_H
|
||||
|
||||
#include "UIComponent.h"
|
||||
#include "DialogCallbackData.h"
|
||||
|
||||
class DialogManager : public UIComponent {
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
static void destroyTmpDialogCallback ( Widget,
|
||||
XtPointer,
|
||||
XtPointer );
|
||||
|
||||
void cleanup ( Widget, DialogCallbackData* );
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
void forceUpdate( Widget );
|
||||
|
||||
// Called to get a new dialog
|
||||
|
||||
Widget getDialog();
|
||||
Widget getDialog(Widget );
|
||||
|
||||
virtual Widget createDialog ( Widget ) = 0;
|
||||
|
||||
static void okCallback ( Widget,
|
||||
XtPointer,
|
||||
XtPointer );
|
||||
|
||||
static void cancelCallback ( Widget,
|
||||
XtPointer,
|
||||
XtPointer );
|
||||
|
||||
static void helpCallback ( Widget,
|
||||
XtPointer,
|
||||
XtPointer );
|
||||
|
||||
|
||||
public:
|
||||
|
||||
DialogManager ( char * );
|
||||
|
||||
virtual Widget post (
|
||||
char *,
|
||||
char *,
|
||||
Widget w,
|
||||
void *clientData = NULL,
|
||||
DialogCallback ok = NULL,
|
||||
DialogCallback cancel = NULL,
|
||||
DialogCallback help = NULL );
|
||||
|
||||
virtual Widget post (
|
||||
char *,
|
||||
char *,
|
||||
void *clientData = NULL,
|
||||
DialogCallback ok = NULL,
|
||||
DialogCallback cancel = NULL,
|
||||
DialogCallback help = NULL );
|
||||
|
||||
virtual int post_and_return(
|
||||
char *,
|
||||
char *,
|
||||
Widget);
|
||||
virtual int post_and_return(
|
||||
char *,
|
||||
char *,
|
||||
char *,
|
||||
Widget);
|
||||
virtual int post_and_return(
|
||||
char *,
|
||||
char *,
|
||||
char *,
|
||||
char *,
|
||||
Widget);
|
||||
|
||||
};
|
||||
#endif
|
||||
108
cde/programs/dtmail/include/MotifApp/Help.hh
Normal file
108
cde/programs/dtmail/include/MotifApp/Help.hh
Normal file
@@ -0,0 +1,108 @@
|
||||
/* $XConsortium: Help.hh /main/5 1996/10/11 20:05:13 cde-hp $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef HELP_HH
|
||||
#define HELP_HH
|
||||
|
||||
#include <Dt/Help.h>
|
||||
|
||||
// Option defines for menubar help access
|
||||
#define HELP_ON_ITEM 1
|
||||
#define HELP_ON_TOPIC 2
|
||||
#define HELP_ON_VERSION 3
|
||||
|
||||
#define DTMAILCONTAINERMENUID "DTMAILVIEWMAINWINDOWMENUBARFILE"
|
||||
#define DTMAILEDITMENUID "DTMAILVIEWMAINWINDOWMENUBAREDIT"
|
||||
#define DTMAILMESSAGEMENUID "DTMAILVIEWMAINWINDOWMENUBARMESSAGE"
|
||||
#define DTMAILATTACHMENUID "DTMAILVIEWMAINWINDOWMENUBARATTACH"
|
||||
#define DTMAILVIEWMENUID "DTMAILVIEWMAINWINDOWMENUBARVIEW"
|
||||
#define DTMAILCOMPOSEMENUID "DTMAILVIEWMAINWINDOWMENUBARCOMPOSE"
|
||||
|
||||
#define APP_MENU_ID "onApplicationMenu"
|
||||
#define VER_MENU_ID "_copyright"
|
||||
|
||||
/************************************************************************
|
||||
* Help location ids for edit area and status line of the DtEditor widget
|
||||
************************************************************************/
|
||||
#define EDIT_AREA_HELP "TextEditorWindow"
|
||||
|
||||
|
||||
/* -----> fields/buttons within the status line */
|
||||
#define STATUS_LINE_HELP "statusLine"
|
||||
#define STATUS_CURRENT_LINE_HELP "status-currentLine"
|
||||
#define STATUS_TOTAL_LINES_HELP "status-totalLines"
|
||||
#define STATUS_MESSAGE_HELP "status-message"
|
||||
#define STATUS_OVERSTRIKE_HELP "status-overstrike"
|
||||
|
||||
/************************************************************************
|
||||
* Help location ids for the dialog posted by [Format] menu [Settings...]
|
||||
* (this dialog is controlled by the DtEditor widget)
|
||||
************************************************************************/
|
||||
#define FORMAT_SETTINGS_HELP "formatDialog"
|
||||
|
||||
/* -----> fields/buttons within the Format Settings dialog */
|
||||
#define FORMAT_LEFT_MARGIN_HELP "format-leftmargin"
|
||||
#define FORMAT_RIGHT_MARGIN_HELP "format-rightmargin"
|
||||
#define FORMAT_ALIGNMENT_HELP "format-alignment"
|
||||
|
||||
/************************************************************************
|
||||
* Help location ids for the dialog posted by [Edit] menu [Find/Change...]
|
||||
* (this dialog is controlled by the DtEditor widget)
|
||||
************************************************************************/
|
||||
#define FINDCHANGE_HELP "findchangeDialog"
|
||||
/* -----> fields/buttons within the Find/Change dialog */
|
||||
#define FINDCHANGE_FIND_HELP "fc-find"
|
||||
#define FINDCHANGE_CHANGETO_HELP "fc-changeto"
|
||||
|
||||
/************************************************************************
|
||||
* Help location ids for the dialog posted by [Edit] menu [Find/Change...]
|
||||
* (this dialog is controlled by the DtEditor widget)
|
||||
************************************************************************/
|
||||
#define SPELL_HELP "spellDialog"
|
||||
|
||||
/* -----> fields/buttons within the Check Spelling dialog */
|
||||
#define SPELL_MISSPELLED_WORDS_HELP "sp-spelllist"
|
||||
#define SPELL_CHANGETO_HELP "sp-changeto"
|
||||
|
||||
|
||||
char *getHelpId(Widget);
|
||||
void printHelpId(char *, Widget);
|
||||
#ifdef DEAD_WOOD
|
||||
void HelpMenuCB(Widget, XtPointer, XtPointer);
|
||||
#endif /* DEAD_WOOD */
|
||||
void HelpCB(Widget, XtPointer, XtPointer);
|
||||
void HelpTexteditCB( Widget, XtPointer, XtPointer ) ;
|
||||
extern void DisplayMain(Widget, char *, char *);
|
||||
Widget getErrorHelpWidget(void);
|
||||
void clearErrorHelpWidget(void);
|
||||
extern void DisplayErrorHelp(Widget, char *, char *);
|
||||
void HelpErrorCB(Widget, XtPointer, XtPointer);
|
||||
extern void DisplayVersion(Widget, char *, char *);
|
||||
static void CloseMainCB(Widget, XtPointer, XtPointer);
|
||||
|
||||
#endif
|
||||
63
cde/programs/dtmail/include/MotifApp/IconifyCmd.h
Normal file
63
cde/programs/dtmail/include/MotifApp/IconifyCmd.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: IconifyCmd.h /main/3 1995/11/06 16:31:17 rswiston $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// IconifyCmd.h: Iconify all windows in a MotifApp application.
|
||||
////////////////////////////////////////////////////////////////
|
||||
#ifndef ICONIFYCMD_H
|
||||
#define ICONIFYCMD_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include "NoUndoCmd.h"
|
||||
|
||||
class IconifyCmd : public NoUndoCmd {
|
||||
|
||||
protected:
|
||||
|
||||
virtual void doit(); // Iconify all windows
|
||||
|
||||
public:
|
||||
|
||||
IconifyCmd ( char *, char *, int );
|
||||
virtual const char *const className () { return "IconifyCmd"; }
|
||||
};
|
||||
#endif
|
||||
69
cde/programs/dtmail/include/MotifApp/InfoDialogManager.h
Normal file
69
cde/programs/dtmail/include/MotifApp/InfoDialogManager.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/* $XConsortium: InfoDialogManager.h /main/4 1996/04/21 19:46:21 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// InfoDialogManager.h
|
||||
//////////////////////////////////////////////////////////
|
||||
#ifndef INFODIALOGMANAGER_H
|
||||
#define INFODIALOGMANAGER_H
|
||||
|
||||
#include "DialogManager.h"
|
||||
|
||||
class InfoDialogManager : public DialogManager {
|
||||
|
||||
protected:
|
||||
|
||||
Widget createDialog ( Widget );
|
||||
|
||||
public:
|
||||
|
||||
InfoDialogManager ( char * );
|
||||
|
||||
};
|
||||
extern DialogManager *theInfoDialogManager;
|
||||
#endif
|
||||
88
cde/programs/dtmail/include/MotifApp/InterruptibleCmd.h
Normal file
88
cde/programs/dtmail/include/MotifApp/InterruptibleCmd.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: InterruptibleCmd.h /main/3 1995/11/06 16:31:32 rswiston $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// InterruptibleCmd.h: Abstract class that supports lengthy,
|
||||
// user-interruptible activities
|
||||
//////////////////////////////////////////////////////////////
|
||||
#ifndef INTERRUPTIBLECMD_H
|
||||
#define INTERRUPTIBLECMD_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include "NoUndoCmd.h"
|
||||
|
||||
// Define a type for the callback invoked when the task is finished
|
||||
|
||||
class InterruptibleCmd;
|
||||
|
||||
typedef void (*TaskDoneCallback) ( InterruptibleCmd *, Boolean, void * );
|
||||
|
||||
class InterruptibleCmd : public NoUndoCmd {
|
||||
|
||||
private:
|
||||
|
||||
XtWorkProcId _wpId; // The ID of the workproc
|
||||
TaskDoneCallback _callback; // Application-defined callback
|
||||
void *_clientData;
|
||||
Boolean workProc ();
|
||||
static Boolean workProcCallback ( XtPointer );
|
||||
static void interruptCallback ( void * );
|
||||
void interrupt();
|
||||
|
||||
protected:
|
||||
|
||||
Boolean _done; // TRUE if the task has been completed
|
||||
virtual void cleanup(); // Called when task ends
|
||||
virtual void updateMessage ( char * );
|
||||
|
||||
// Derived classes implement doit(), declared by Cmd
|
||||
|
||||
public:
|
||||
|
||||
InterruptibleCmd ( char *, char *, int );
|
||||
virtual ~InterruptibleCmd();
|
||||
|
||||
virtual void execute(); // Overrides base class member function
|
||||
virtual void execute ( TaskDoneCallback, void * );
|
||||
};
|
||||
#endif
|
||||
126
cde/programs/dtmail/include/MotifApp/MainWindow.h
Normal file
126
cde/programs/dtmail/include/MotifApp/MainWindow.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/* $TOG: MainWindow.h /main/11 1998/08/21 15:57:56 mgreess $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// MainWindow.h: Support a toplevel window
|
||||
////////////////////////////////////////////////////////////////////
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include "UIComponent.h"
|
||||
|
||||
class MainWindow : public UIComponent {
|
||||
|
||||
protected:
|
||||
|
||||
Widget _main; // The XmMainWindow widget
|
||||
Widget _workArea; // Widget created by derived class
|
||||
Boolean _allow_resize;
|
||||
Pixmap _icon;
|
||||
GC _icon_invert;
|
||||
GC _window_invert;
|
||||
int _last_state;
|
||||
Window _flash_owin;
|
||||
Window _flash_iwin;
|
||||
XWindowAttributes
|
||||
_window_attributes;
|
||||
|
||||
// Derived classes must define this function to
|
||||
// create the application-specific work area.
|
||||
|
||||
virtual Widget createWorkArea ( Widget ) = 0;
|
||||
|
||||
virtual void getIconColors(Pixmap & fore, Pixmap & back);
|
||||
|
||||
public:
|
||||
|
||||
MainWindow ( char *name, Boolean allowResize=FALSE );
|
||||
virtual ~MainWindow();
|
||||
|
||||
// The Application class automatically calls initialize()
|
||||
// for all registered main window objects
|
||||
|
||||
virtual void initialize();
|
||||
virtual void disableWorkAreaResize();
|
||||
virtual void enableWorkAreaResize();
|
||||
virtual void manage(); // popup the window
|
||||
virtual void unmanage(); // pop down the window
|
||||
virtual void iconify();
|
||||
virtual void setIconTitle(const char * title);
|
||||
virtual void setIconName(const char * name);
|
||||
virtual void title(const char *);
|
||||
virtual void flash(const int count);
|
||||
virtual void quit(Boolean delete_win = FALSE)=0;
|
||||
virtual void panicQuit()=0;
|
||||
virtual Boolean isIconified();
|
||||
|
||||
// Functions to control session management.
|
||||
virtual int smpSaveSessionGlobal(void) = 0;
|
||||
virtual void smpSaveSessionLocal(void) = 0;
|
||||
|
||||
|
||||
virtual void busyCursor(void);
|
||||
virtual void normalCursor(void);
|
||||
|
||||
virtual void setStatus(const char *);
|
||||
virtual void clearStatus(void);
|
||||
|
||||
virtual void propsChanged(void) = 0;
|
||||
|
||||
void setWorkspacesOccupied(char *workspaces);
|
||||
char *MbStrchr(char *str, int ch);
|
||||
|
||||
private:
|
||||
static void quitCallback( Widget, XtPointer, XmAnyCallbackStruct * );
|
||||
|
||||
static void flashCallback(XtPointer, XtIntervalId *);
|
||||
void doFlash(XtIntervalId *);
|
||||
|
||||
int _flashing;
|
||||
};
|
||||
#endif
|
||||
63
cde/programs/dtmail/include/MotifApp/ManageCmd.h
Normal file
63
cde/programs/dtmail/include/MotifApp/ManageCmd.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: ManageCmd.h /main/3 1995/11/06 16:31:48 rswiston $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// ManageCmd.h: Manage all windows in a MotifApp application.
|
||||
//////////////////////////////////////////////////////////////
|
||||
#ifndef MANAGECMD_H
|
||||
#define MANAGECMD_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include "NoUndoCmd.h"
|
||||
|
||||
class ManageCmd : public NoUndoCmd {
|
||||
|
||||
protected:
|
||||
|
||||
virtual void doit(); // Manage all windows
|
||||
|
||||
public:
|
||||
|
||||
ManageCmd ( char *, char *, int );
|
||||
virtual const char *const className () { return "ManageCmd"; }
|
||||
};
|
||||
#endif
|
||||
112
cde/programs/dtmail/include/MotifApp/MenuBar.h
Normal file
112
cde/programs/dtmail/include/MotifApp/MenuBar.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/* $XConsortium: MenuBar.h /main/4 1996/04/21 19:46:27 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// MenuBar.h: A menu bar, whose panes support items
|
||||
// that execute Cmds
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// MODIFIED TO SUPPORT SUBMENUS - not described in Book
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef MENUBAR_H
|
||||
#define MENUBAR_H
|
||||
|
||||
#include "UIComponent.h"
|
||||
#include <Xm/RowColumn.h>
|
||||
|
||||
class Cmd;
|
||||
class CmdList;
|
||||
|
||||
class MenuBar : public UIComponent {
|
||||
protected:
|
||||
#ifdef DEAD_WOOD
|
||||
virtual Boolean isValidMenuPane(Widget);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
virtual Widget createPulldown ( Widget, CmdList *,
|
||||
Boolean, unsigned char);
|
||||
|
||||
virtual Widget createPulldown ( Widget, CmdList *,
|
||||
Widget *, Boolean, unsigned char);
|
||||
|
||||
public:
|
||||
|
||||
MenuBar ( Widget, char *, unsigned char = XmMENU_BAR );
|
||||
|
||||
// Create a named menu pane from a list of Cmd objects
|
||||
|
||||
virtual Widget addCommands ( Widget *, CmdList *, Boolean = FALSE,
|
||||
unsigned char = XmMENU_BAR);
|
||||
|
||||
virtual Widget addCommands ( CmdList *, Boolean = FALSE,
|
||||
unsigned char = XmMENU_BAR);
|
||||
|
||||
virtual Widget addCommands ( Widget, CmdList *);
|
||||
|
||||
virtual void addCommand ( Widget, Cmd *);
|
||||
|
||||
virtual void removeCommands( Widget, CmdList *);
|
||||
|
||||
virtual void removeCommand( Widget, int at);
|
||||
|
||||
virtual void removeOnlyCommands( Widget, CmdList *);
|
||||
|
||||
|
||||
virtual void changeLabel ( Widget, int, char *);
|
||||
|
||||
virtual void changeLabel(Widget, const char * wid_name, const char * label);
|
||||
|
||||
virtual void rotateLabels ( Widget, int, int );
|
||||
|
||||
virtual const char *const className() { return "MenuBar"; }
|
||||
};
|
||||
#endif
|
||||
83
cde/programs/dtmail/include/MotifApp/MenuWindow.h
Normal file
83
cde/programs/dtmail/include/MotifApp/MenuWindow.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/* $TOG: MenuWindow.h /main/5 1997/06/04 18:43:25 mgreess $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// MenuWindow.C: Add a menubar to the features of MainWindow
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef MENUWINDOW_H
|
||||
#define MENUWINDOW_H
|
||||
|
||||
#include "MainWindow.h"
|
||||
|
||||
class MenuBar;
|
||||
|
||||
class MenuWindow : public MainWindow {
|
||||
private:
|
||||
|
||||
protected:
|
||||
|
||||
MenuBar *_menuBar;
|
||||
|
||||
virtual void initialize(); // Called by Application
|
||||
virtual void createMenuPanes() = 0; // Defined by derived
|
||||
// classes to specify the
|
||||
// contents of the menu
|
||||
|
||||
#ifndef CPLUSPLUS2_1
|
||||
virtual Widget createWorkArea ( Widget ) = 0;
|
||||
#endif
|
||||
|
||||
virtual void getIconColors(Pixmap & fore, Pixmap & back);
|
||||
|
||||
public:
|
||||
|
||||
MenuWindow ( char *name, Boolean allowResize=FALSE );
|
||||
virtual ~MenuWindow();
|
||||
};
|
||||
#endif
|
||||
85
cde/programs/dtmail/include/MotifApp/MotifCmds.h
Normal file
85
cde/programs/dtmail/include/MotifApp/MotifCmds.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/* $TOG: MotifCmds.h /main/5 1998/09/21 18:52:49 mgreess $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
// MotifCmds.h: Menu cmds
|
||||
/////////////////////////////////////////////////////////
|
||||
#ifndef MOTIFCMDS_H
|
||||
#define MOTIFCMDS_H
|
||||
|
||||
#include "Cmd.h"
|
||||
#include "CmdInterface.h"
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/ToggleB.h>
|
||||
|
||||
|
||||
// Elsewhere in MotifApp, we refer to instances of these classes
|
||||
// via their className() method. We compare them to SeparatorCmd
|
||||
// or ToggleButtonCmd.
|
||||
// We want derived classes to also answer to the same className().
|
||||
// So, we make className() a non-virtual method.
|
||||
|
||||
class SeparatorCmd : public Cmd {
|
||||
public:
|
||||
virtual void doit();
|
||||
virtual void undoit();
|
||||
SeparatorCmd( char *, char *, int );
|
||||
const char *const className () { return "SeparatorCmd"; }
|
||||
};
|
||||
|
||||
// Its critical that children of ToggleButtonCmd not have a
|
||||
// const className() method.
|
||||
// Make className() a non-virtual method then.
|
||||
|
||||
class ToggleButtonCmd : public Cmd {
|
||||
public:
|
||||
virtual void doit();
|
||||
virtual void undoit();
|
||||
ToggleButtonCmd(
|
||||
char *name, char *label, int active,
|
||||
Boolean visible_when_off=TRUE,
|
||||
unsigned char indicator_type=XmONE_OF_MANY_ROUND);
|
||||
|
||||
unsigned char indicatorType();
|
||||
Boolean visibleWhenOff();
|
||||
Boolean getButtonState();
|
||||
void setButtonState(Boolean, Boolean);
|
||||
|
||||
#ifdef CAN_INLINE_VIRTUALS
|
||||
const char *const className () { return "ToggleButtonCmd"; }
|
||||
#else /* ! CAN_INLINE_VIRTUALS */
|
||||
const char *const className ();
|
||||
#endif /* ! CAN_INLINE_VIRTUALS */
|
||||
|
||||
unsigned char _indicator_type;
|
||||
Boolean _visible_when_off;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
66
cde/programs/dtmail/include/MotifApp/NoUndoCmd.h
Normal file
66
cde/programs/dtmail/include/MotifApp/NoUndoCmd.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: NoUndoCmd.h /main/3 1995/11/06 16:32:22 rswiston $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// NoUndoCmd.h: Base class for all commands without undo
|
||||
//////////////////////////////////////////////////////////
|
||||
#ifndef NOUNDOCMD_H
|
||||
#define NOUNDOCMD_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include "Cmd.h"
|
||||
|
||||
class NoUndoCmd : public Cmd {
|
||||
|
||||
protected:
|
||||
|
||||
#ifndef CPLUSPLUS2_1
|
||||
virtual void doit() = 0; // Specific actions must be defined
|
||||
#endif
|
||||
|
||||
virtual void undoit();
|
||||
|
||||
public:
|
||||
|
||||
NoUndoCmd ( char *, char *, int );
|
||||
};
|
||||
#endif
|
||||
78
cde/programs/dtmail/include/MotifApp/PixmapCycler.h
Normal file
78
cde/programs/dtmail/include/MotifApp/PixmapCycler.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/* $XConsortium: PixmapCycler.h /main/4 1996/04/21 19:46:36 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// PixmapCycler.h: Abstract class that supports a continuous cycle
|
||||
// of pixmaps for short animation sequences.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
#ifndef PIXMAPCYCLER_H
|
||||
#define PIXMAPCYCLER_H
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
class PixmapCycler {
|
||||
|
||||
protected:
|
||||
|
||||
int _numPixmaps; // Total number of pixmaps in cycle
|
||||
int _current; // Index of the current pixmap
|
||||
Pixmap *_pixmapList; // The array of pixmaps
|
||||
Dimension _width, _height; // Pixmap size
|
||||
|
||||
virtual void createPixmaps() = 0; // Derived class must implement
|
||||
PixmapCycler ( int, Dimension, Dimension );
|
||||
|
||||
public:
|
||||
|
||||
virtual ~PixmapCycler();
|
||||
Dimension width() { return _width; }
|
||||
Dimension height() { return _height; }
|
||||
|
||||
Pixmap next(); // Return the next pixmap in the cycle
|
||||
};
|
||||
#endif
|
||||
86
cde/programs/dtmail/include/MotifApp/PromptDialogManager.h
Normal file
86
cde/programs/dtmail/include/MotifApp/PromptDialogManager.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/* $XConsortium: PromptDialogManager.h /main/4 1996/04/21 19:46:39 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// PromptDialogManager.h
|
||||
//////////////////////////////////////////////////////////
|
||||
#ifndef PROMPTDIALOGMANAGER_H
|
||||
#define PROMPTDIALOGMANAGER_H
|
||||
|
||||
#include "DialogManager.h"
|
||||
|
||||
class PromptDialogManager : public DialogManager {
|
||||
|
||||
protected:
|
||||
|
||||
Widget createDialog ( Widget );
|
||||
|
||||
public:
|
||||
|
||||
PromptDialogManager ( char * );
|
||||
virtual Widget post (char*,
|
||||
char *,
|
||||
void *clientData = NULL,
|
||||
DialogCallback ok = NULL,
|
||||
DialogCallback cancel = NULL,
|
||||
DialogCallback help = NULL );
|
||||
|
||||
virtual Widget post (char *,
|
||||
char *,
|
||||
Widget ,
|
||||
void *clientData = NULL,
|
||||
DialogCallback ok = NULL,
|
||||
DialogCallback cancel = NULL,
|
||||
DialogCallback help = NULL );
|
||||
|
||||
|
||||
};
|
||||
|
||||
extern PromptDialogManager *thePromptDialogManager;
|
||||
|
||||
#endif
|
||||
72
cde/programs/dtmail/include/MotifApp/QuestionDialogManager.h
Normal file
72
cde/programs/dtmail/include/MotifApp/QuestionDialogManager.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* $XConsortium: QuestionDialogManager.h /main/4 1996/04/21 19:46:42 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// QuestionDialogManager.h
|
||||
//////////////////////////////////////////////////////////
|
||||
#ifndef QuestionDIALOGMANAGER_H
|
||||
#define QuestionDIALOGMANAGER_H
|
||||
|
||||
#include "DialogManager.h"
|
||||
|
||||
class QuestionDialogManager : public DialogManager {
|
||||
|
||||
protected:
|
||||
|
||||
Widget createDialog ( Widget );
|
||||
|
||||
public:
|
||||
|
||||
QuestionDialogManager ( char * );
|
||||
};
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
extern QuestionDialogManager *theQuestionDialogManager;
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
#endif
|
||||
66
cde/programs/dtmail/include/MotifApp/QuitCmd.h
Normal file
66
cde/programs/dtmail/include/MotifApp/QuitCmd.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: QuitCmd.h /main/3 1995/11/06 16:32:51 rswiston $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// QuitCmd.h: Exit an application after checking with user.
|
||||
////////////////////////////////////////////////////////////
|
||||
#ifndef QUITCMD_H
|
||||
#define QUITCMD_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include "WarnNoUndoCmd.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
class QuitCmd : public WarnNoUndoCmd {
|
||||
|
||||
protected:
|
||||
|
||||
virtual void doit(); // Call exit
|
||||
MainWindow *_mywindow;
|
||||
|
||||
public:
|
||||
|
||||
QuitCmd ( char *, char *, int, MainWindow *);
|
||||
virtual const char *const className () { return "QuitCmd"; }
|
||||
virtual void execute(); // Overrides the AskFirstCmd member function
|
||||
};
|
||||
#endif
|
||||
48
cde/programs/dtmail/include/MotifApp/ScrollingList.h
Normal file
48
cde/programs/dtmail/include/MotifApp/ScrollingList.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* $XConsortium: ScrollingList.h /main/4 1996/04/21 19:46:45 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef SCROLLINGLIST_H
|
||||
#define SCROLLINGLIST_H
|
||||
|
||||
#include "UIComponent.h"
|
||||
#include <Xm/List.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
class ScrollingList : public UIComponent {
|
||||
private:
|
||||
static void defaultActionCallback( Widget, XtPointer, XmListCallbackStruct * );
|
||||
|
||||
public:
|
||||
|
||||
ScrollingList ( Widget, char * );
|
||||
~ScrollingList ();
|
||||
virtual const char *const className() { return ( "ScrollingList" ); }
|
||||
virtual void defaultAction( Widget, XtPointer, XmListCallbackStruct * ) = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
120
cde/programs/dtmail/include/MotifApp/SelectFileCmd.h
Normal file
120
cde/programs/dtmail/include/MotifApp/SelectFileCmd.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $TOG: SelectFileCmd.h /main/5 1997/05/30 17:47:20 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// SelectFileCmd.h: Allow the user to select a file interactively
|
||||
///////////////////////////////////////////////////////////////////
|
||||
#ifndef SELECTFILECMD_H
|
||||
#define SELECTFILECMD_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include "NoUndoCmd.h"
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/ToggleB.h>
|
||||
|
||||
typedef void (*FileCallback) ( void *, char * );
|
||||
|
||||
class SelectFileCmd : public NoUndoCmd {
|
||||
|
||||
private:
|
||||
|
||||
static void fileSelectedCB ( Widget, XtPointer, XtPointer );
|
||||
static void fileCanceledCB ( Widget, XtPointer, XtPointer );
|
||||
static void hiddenCB(Widget, XtPointer, XtPointer);
|
||||
void doHidden(int);
|
||||
|
||||
protected:
|
||||
|
||||
void doit(); // Called by base class
|
||||
char * _ok_label;
|
||||
char * _title;
|
||||
|
||||
FileCallback _ok_callback; // Function called when user selects file.
|
||||
void *_ok_clientData; // Data provided for ok callback.
|
||||
FileCallback _cancel_callback; // Function called when user cancels.
|
||||
void *_cancel_clientData; // Data provided for cancel callback.
|
||||
|
||||
Widget _fileBrowser; // The Motif widget used to get file
|
||||
|
||||
Widget _parentWidget; // Need it to parent fileBrowser.
|
||||
Widget _hidden_button;
|
||||
|
||||
XmString _directory; // The directory pointed to.
|
||||
|
||||
virtual void fileSelected (char *);
|
||||
virtual void fileCanceled ();
|
||||
|
||||
public:
|
||||
|
||||
SelectFileCmd (const char * name,
|
||||
const char * label,
|
||||
const char * title,
|
||||
const char * ok_label,
|
||||
int active,
|
||||
FileCallback callback, // ok callback
|
||||
void * clientData, // ok data
|
||||
Widget parent);
|
||||
|
||||
SelectFileCmd (const char * name,
|
||||
const char * label,
|
||||
const char * title,
|
||||
const char * ok_label,
|
||||
int active,
|
||||
FileCallback ok_callback, // ok callback
|
||||
void * ok_clientData, // ok data
|
||||
FileCallback cancel_callback, // cancel callback
|
||||
void * cancel_clientData, // cancel data
|
||||
Widget parent);
|
||||
~SelectFileCmd ();
|
||||
|
||||
char *getDirectory();
|
||||
char *getSelected();
|
||||
int getHidden();
|
||||
|
||||
void setDirectory(char *);
|
||||
void setSelected(char *);
|
||||
void setHidden(int);
|
||||
|
||||
Widget fileBrowser(void) { return _fileBrowser; }
|
||||
Widget hiddenButton(void) { return _hidden_button; }
|
||||
};
|
||||
#endif
|
||||
39
cde/programs/dtmail/include/MotifApp/ShutdownActions.hh
Normal file
39
cde/programs/dtmail/include/MotifApp/ShutdownActions.hh
Normal file
@@ -0,0 +1,39 @@
|
||||
/* $XConsortium: ShutdownActions.hh /main/3 1996/04/21 19:46:48 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
#ifndef _SHUTDOWNACTIONS_HH
|
||||
#define _SHUTDOWNACTIONS_HH
|
||||
|
||||
class ShutdownActions {
|
||||
public:
|
||||
ShutdownActions(int num_actions = 32);
|
||||
~ShutdownActions(void);
|
||||
|
||||
typedef int (*ShutdownActionProc)(void *);
|
||||
|
||||
void addAction(ShutdownActionProc, void * cb_data);
|
||||
void removeAction(ShutdownActionProc, void * cb_data);
|
||||
|
||||
int doActions(void);
|
||||
|
||||
private:
|
||||
struct ActionEntry {
|
||||
ShutdownActionProc proc;
|
||||
void * call_back_data;
|
||||
};
|
||||
|
||||
ActionEntry *_actions;
|
||||
int _action_list_size;
|
||||
int _action_count;
|
||||
|
||||
void removeEntry(int);
|
||||
};
|
||||
|
||||
#endif
|
||||
49
cde/programs/dtmail/include/MotifApp/ToggleButtonInterface.h
Normal file
49
cde/programs/dtmail/include/MotifApp/ToggleButtonInterface.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* $XConsortium: ToggleButtonInterface.h /main/4 1996/04/21 19:46:51 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// ToggleButtonInterface.h: A togglebutton interface to a Cmd object
|
||||
///////////////////////////////////////////////////////////////
|
||||
#ifndef TOGGLEBUTTONINTERFACE
|
||||
#define TOGGLEBUTTONINTERFACE
|
||||
|
||||
#include "CmdInterface.h"
|
||||
|
||||
class ToggleButtonInterface : public CmdInterface {
|
||||
|
||||
public:
|
||||
|
||||
ToggleButtonInterface ( Widget, Cmd * );
|
||||
#ifndef CAN_INLINE_VIRTUALS
|
||||
~ToggleButtonInterface ( void );
|
||||
#endif /* ! CAN_INLINE_VIRTUALS */
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
113
cde/programs/dtmail/include/MotifApp/UIComponent.h
Normal file
113
cde/programs/dtmail/include/MotifApp/UIComponent.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $TOG: UIComponent.h /main/6 1998/01/29 15:18:31 mgreess $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
// UIComponent.h: Base class for all C++/Motif UI components
|
||||
///////////////////////////////////////////////////////////////
|
||||
#ifndef UICOMPONENT_H
|
||||
#define UICOMPONENT_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include "BasicComponent.h"
|
||||
|
||||
class UIComponent : public BasicComponent {
|
||||
|
||||
private:
|
||||
|
||||
// Interface between XmNdestroyCallback and this class
|
||||
|
||||
static void widgetDestroyedCallback ( Widget,
|
||||
XtPointer,
|
||||
XtPointer );
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
// Number of pending tasks.
|
||||
// UIComponents with pending tasks should not be terminated.
|
||||
// Used in Application and MainWindow classes to block termination.
|
||||
//
|
||||
int _numPendingTasks;
|
||||
|
||||
// Protect constructor to prevent direct instantiation
|
||||
UIComponent ( const char * );
|
||||
|
||||
void installDestroyHandler(); // Easy hook for derived classes
|
||||
|
||||
// Called by widgetDestroyedCallback() if base widget is destroyed
|
||||
virtual void widgetDestroyed();
|
||||
|
||||
#ifdef DEAD_WOOD
|
||||
// Loads component's default resources into database
|
||||
void setDefaultResources ( const Widget , const String *);
|
||||
#endif /* DEAD_WOOD */
|
||||
|
||||
// Retrieve resources for this clsss from the resource manager
|
||||
void getResources ( const XtResourceList, const int );
|
||||
|
||||
public:
|
||||
|
||||
virtual ~UIComponent();
|
||||
|
||||
// Manage the entire widget subtree represented
|
||||
// by this component. Overrides BasicComponent method
|
||||
virtual void manage();
|
||||
virtual void displayInCurrentWorkspace();
|
||||
virtual void displayInCurrentWorkspace(Widget);
|
||||
|
||||
// Public access functions
|
||||
#ifdef CAN_INLINE_VIRTUALS
|
||||
virtual const char *const className() { return "UIComponent"; }
|
||||
#else
|
||||
virtual const char *const className();
|
||||
#endif
|
||||
|
||||
//
|
||||
// Functions for registering and unregistering tasks
|
||||
// which will block termination.
|
||||
//
|
||||
void registerPendingTask() { _numPendingTasks++; }
|
||||
void unregisterPendingTask() { _numPendingTasks--; }
|
||||
};
|
||||
|
||||
#endif
|
||||
65
cde/programs/dtmail/include/MotifApp/UndoCmd.h
Normal file
65
cde/programs/dtmail/include/MotifApp/UndoCmd.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: UndoCmd.h /main/3 1995/11/06 16:33:29 rswiston $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// UndoCmd.h: An interface for undoing the last command
|
||||
//////////////////////////////////////////////////////////
|
||||
#ifndef UNDOCMD_H
|
||||
#define UNDOCMD_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include "NoUndoCmd.h"
|
||||
|
||||
class UndoCmd : public NoUndoCmd {
|
||||
|
||||
protected:
|
||||
|
||||
virtual void doit();
|
||||
|
||||
public:
|
||||
|
||||
UndoCmd ( char *, char * );
|
||||
};
|
||||
|
||||
extern UndoCmd *theUndoCmd;
|
||||
|
||||
#endif
|
||||
63
cde/programs/dtmail/include/MotifApp/WarnNoUndoCmd.h
Normal file
63
cde/programs/dtmail/include/MotifApp/WarnNoUndoCmd.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* $XConsortium: WarnNoUndoCmd.h /main/3 1995/11/06 16:33:36 rswiston $
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// WarnNoUndoCmd.h: Warns user before executing a command
|
||||
//////////////////////////////////////////////////////////
|
||||
#ifndef WARNNOUNDOCMD_H
|
||||
#define WARNNOUNDOCMD_H
|
||||
|
||||
#ifndef I_HAVE_NO_IDENT
|
||||
#endif
|
||||
|
||||
#include "AskFirstCmd.h"
|
||||
|
||||
class WarnNoUndoCmd : public AskFirstCmd {
|
||||
|
||||
protected:
|
||||
|
||||
virtual void undoit();
|
||||
|
||||
public:
|
||||
|
||||
WarnNoUndoCmd ( char *, char *, int );
|
||||
virtual const char *const className () { return "WarnNoUndoCmd"; }
|
||||
};
|
||||
#endif
|
||||
99
cde/programs/dtmail/include/MotifApp/WorkingDialogManager.h
Normal file
99
cde/programs/dtmail/include/MotifApp/WorkingDialogManager.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/* $XConsortium: WorkingDialogManager.h /main/4 1996/04/21 19:46:54 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement between
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel without
|
||||
* Sun's specific written approval. This document and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// This example code is from the book:
|
||||
//
|
||||
// Object-Oriented Programming with C++ and OSF/Motif
|
||||
// by
|
||||
// Douglas Young
|
||||
// Prentice Hall, 1992
|
||||
// ISBN 0-13-630252-1
|
||||
//
|
||||
// Copyright 1991 by Prentice Hall
|
||||
// All Rights Reserved
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software for
|
||||
// any purpose except publication and without fee is hereby granted, provided
|
||||
// that the above copyright notice appear in all copies of the software.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// WorkingDialogManager.h
|
||||
//////////////////////////////////////////////////////////
|
||||
#ifndef WORKINGDIALOGMANAGER_H
|
||||
#define WORKINGDIALOGMANAGER_H
|
||||
|
||||
#include "DialogManager.h"
|
||||
|
||||
class PixmapCycler;
|
||||
|
||||
class WorkingDialogManager : public DialogManager {
|
||||
|
||||
protected:
|
||||
|
||||
Widget createDialog ( Widget );
|
||||
PixmapCycler *_busyPixmaps; // Source of animated pixmap sequence
|
||||
|
||||
XtIntervalId _intervalId; // ID of the last timeout
|
||||
|
||||
static void unpostCallback ( Widget, XtPointer, XtPointer );
|
||||
static void timerCallback ( XtPointer, XtIntervalId * );
|
||||
|
||||
void timer ( );
|
||||
|
||||
public:
|
||||
|
||||
WorkingDialogManager ( char * );
|
||||
|
||||
virtual Widget post (char *,
|
||||
char *,
|
||||
void *clientData = NULL,
|
||||
DialogCallback ok = NULL,
|
||||
DialogCallback cancel = NULL,
|
||||
DialogCallback help = NULL );
|
||||
|
||||
virtual Widget post (char *,
|
||||
char *,
|
||||
Widget ,
|
||||
void *clientData = NULL,
|
||||
DialogCallback ok = NULL,
|
||||
DialogCallback cancel = NULL,
|
||||
DialogCallback help = NULL );
|
||||
|
||||
void unpost(); // Remove the dialog from the screen
|
||||
|
||||
void updateMessage ( char * ); // Change the text in the dialog
|
||||
};
|
||||
|
||||
extern WorkingDialogManager *theWorkingDialogManager;
|
||||
|
||||
#endif
|
||||
56
cde/programs/dtmail/include/MotifApp/dtmailopts.h
Normal file
56
cde/programs/dtmail/include/MotifApp/dtmailopts.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* $XConsortium: dtmailopts.h /main/3 1995/11/06 16:33:51 rswiston $ */
|
||||
/*** DTB_USER_CODE_START vvv Add file header below vvv ***/
|
||||
/*** DTB_USER_CODE_END ^^^ Add file header above ^^^ ***/
|
||||
|
||||
/*
|
||||
* File: dtmailopts.h
|
||||
* Contains: object data structures and callback declarations
|
||||
*
|
||||
* This file was generated by dtcodegen, from project dtmailopts
|
||||
*
|
||||
* Any text may be added between the DTB_USER_CODE_START and
|
||||
* DTB_USER_CODE_END comments (even non-C code). Descriptive comments
|
||||
* are provided only as an aid.
|
||||
*
|
||||
* ** EDIT ONLY WITHIN SECTIONS MARKED WITH DTB_USER_CODE COMMENTS. **
|
||||
* ** ALL OTHER MODIFICATIONS WILL BE OVERWRITTEN. DO NOT MODIFY OR **
|
||||
* ** DELETE THE GENERATED COMMENTS! **
|
||||
*/
|
||||
#ifndef _DTMAILOPTS_H_
|
||||
#define _DTMAILOPTS_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <nl_types.h>
|
||||
#define DTB_PROJECT_CATALOG "dtmailopts"
|
||||
/* Handle for standard message catalog for the project */
|
||||
extern nl_catd Dtb_project_catd;
|
||||
|
||||
/*
|
||||
* Structure to store values for Application Resources
|
||||
*/
|
||||
typedef struct {
|
||||
char *session_file;
|
||||
|
||||
/*** DTB_USER_CODE_START vvv Add structure fields below vvv ***/
|
||||
/*** DTB_USER_CODE_END ^^^ Add structure fields above ^^^ ***/
|
||||
} DtbAppResourceRec;
|
||||
|
||||
|
||||
extern DtbAppResourceRec dtb_app_resource_rec;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*** DTB_USER_CODE_START
|
||||
***
|
||||
*** Add types, macros, and externs here
|
||||
***/
|
||||
|
||||
/*** DTB_USER_CODE_END
|
||||
***
|
||||
*** End of user code section
|
||||
***
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#endif /* _DTMAILOPTS_H_ */
|
||||
31
cde/programs/dtmail/include/MotifApp/mailtest.h
Normal file
31
cde/programs/dtmail/include/MotifApp/mailtest.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: mailtest.h /main/3 1995/11/06 16:33:59 rswiston $ */
|
||||
/*
|
||||
* File: mailtest.h
|
||||
* Contains object data structures and callback declarations
|
||||
|
||||
*
|
||||
* This file was generated from mailtest by dtcodegen
|
||||
*
|
||||
* ** DO NOT MODIFY BY HAND - ALL MODIFICATIONS WILL BE LOST **
|
||||
*
|
||||
*/
|
||||
#ifndef _MAILTEST_H_
|
||||
#define _MAILTEST_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
/*
|
||||
* Structure to store values for Application Resources
|
||||
*/
|
||||
typedef struct {
|
||||
char *session_file;
|
||||
|
||||
/* vvv Add client code below vvv */
|
||||
} DtbAppResourceRec;
|
||||
|
||||
|
||||
extern DtbAppResourceRec dtb_app_resource_rec;
|
||||
|
||||
#endif /* _MAILTEST_H_ */
|
||||
|
||||
63
cde/programs/dtmail/include/utils/EUSDebug.hh
Normal file
63
cde/programs/dtmail/include/utils/EUSDebug.hh
Normal file
@@ -0,0 +1,63 @@
|
||||
/* $XConsortium: EUSDebug.hh /main/3 1996/04/21 19:46:57 drk $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _DEBUG_HH
|
||||
#define _DEBUG_HH
|
||||
|
||||
#if defined(DEBUG)
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
extern int EUSDebugLevel;
|
||||
|
||||
inline void
|
||||
initDebug(void)
|
||||
{
|
||||
char * level = getenv("EUS_DEBUG");
|
||||
|
||||
if (level) {
|
||||
EUSDebugLevel = atoi(level);
|
||||
}
|
||||
else {
|
||||
EUSDebugLevel = 0;
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
DebugPrintf(int level, const char * fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
if (level <= EUSDebugLevel) {
|
||||
va_start(args, fmt);
|
||||
fprintf(stderr, "EUS DEBUG: ");
|
||||
vfprintf(stderr, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
inline void initDebug(void) {}
|
||||
inline void DebugPrintf(int, const char *, ...) {}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
175
cde/programs/dtmail/include/utils/MemUtils.hh
Normal file
175
cde/programs/dtmail/include/utils/MemUtils.hh
Normal file
@@ -0,0 +1,175 @@
|
||||
/* $TOG: MemUtils.hh /main/5 1998/04/06 13:25:12 mgreess $ */
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _MEMUTILS_HH
|
||||
#define _MEMUTILS_HH
|
||||
|
||||
#include <string.h>
|
||||
|
||||
// The FORCE_SEGV_DECL macro is used to declare pointers on the stack. It
|
||||
// will initialize the pointer in such a way as to force SEGV if it is
|
||||
// used before set, and created detectable errors if it is freed before
|
||||
// set. This macro should be used any time an uninitialized pointer would
|
||||
// be created.
|
||||
//
|
||||
// Usage:
|
||||
// Instead of:
|
||||
// char * a_string;
|
||||
//
|
||||
// Do:
|
||||
// FORCE_SEGV_DECL(char, a_string);
|
||||
//
|
||||
// Note that the * is not specified on the type or variable name.
|
||||
//
|
||||
#ifdef DEBUG
|
||||
#define FORCE_SEGV_CONST (0x13)
|
||||
#define FORCE_SEGV_DECL(a, b) a *b = (a *)FORCE_SEGV_CONST
|
||||
#else
|
||||
#define FORCE_SEGV_CONST (0)
|
||||
#define FORCE_SEGV_DECL(a, b) a *b = (a *)FORCE_SEGV_CONST
|
||||
#endif
|
||||
|
||||
// The strdup_n function replaces the functionality of strdup(3C), but uses
|
||||
// the C++ new operator. This is provided to allow consistent use of
|
||||
// the delete operator when handling strings.
|
||||
//
|
||||
inline
|
||||
char *
|
||||
strdup_n(const char * old_str)
|
||||
{
|
||||
char * new_str = (char *) NULL;
|
||||
|
||||
if (old_str) new_str = new char[strlen(old_str) + 1];
|
||||
return(new_str ? strcpy(new_str, old_str) : (char*) NULL);
|
||||
}
|
||||
|
||||
// The grow_region function provides the functionality of realloc(3C) for
|
||||
// memory that has been allocated with new. This is provided to allow
|
||||
// consistent use of the delete operator for memory regions that must
|
||||
// be resized.
|
||||
//
|
||||
inline
|
||||
void *
|
||||
grow_region(void * old_region, const int old_size, const int new_size)
|
||||
{
|
||||
void * new_region = new unsigned char[new_size];
|
||||
if (new_region) {
|
||||
memcpy(new_region, old_region, old_size);
|
||||
}
|
||||
delete old_region;
|
||||
return(new_region);
|
||||
}
|
||||
|
||||
// The StackProbe class is used to debug stack over runs. It works by
|
||||
// allocating two pages on the stack, and mprotecting one of the pages.
|
||||
// The reason two pages are used is mprotect must protect entire pages.
|
||||
// The top of the stack in any given routine will most likely not be
|
||||
// on an even page boundary, so two pages are allocated to get one that
|
||||
// can be protected.
|
||||
//
|
||||
#if defined(DEBUG) && defined(STACK_PROBE)
|
||||
|
||||
#ifndef STACK_PAGE_SIZE
|
||||
#define STACK_PAGE_SIZE 4096
|
||||
#endif
|
||||
|
||||
#include <sys/mman.h>
|
||||
|
||||
class StackProbe {
|
||||
public:
|
||||
StackProbe(void) {
|
||||
caddr_t page_start = ®ion[((int)®ion % STACK_PAGE_SIZE)];
|
||||
mprotect(page_start, STACK_PAGE_SIZE, PROT_NONE);
|
||||
}
|
||||
|
||||
~StackProbe(void) {
|
||||
caddr_t page_start = ®ion[((int)®ion % STACK_PAGE_SIZE)];
|
||||
mprotect(page_start, STACK_PAGE_SIZE, PROT_READ | PROT_WRITE);
|
||||
}
|
||||
|
||||
private:
|
||||
char region[STACK_PAGE_SIZE * 2];
|
||||
};
|
||||
|
||||
#define INSERT_STACK_PROBE StackProbe _stack_probe;
|
||||
#endif
|
||||
|
||||
#ifndef INSERT_STACK_PROBE
|
||||
#define INSERT_STACK_PROBE
|
||||
#endif
|
||||
|
||||
#if defined(SENTINEL) && defined(DEBUG)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sentinel.h>
|
||||
|
||||
inline
|
||||
void
|
||||
MdbgAddWatchPoint(const void * ptr, const size_t len)
|
||||
{
|
||||
SeAddWatchPoint((void *)ptr, (size_t)len, "check");
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
MdbgChainCheck(void)
|
||||
{
|
||||
SeChainCheck(1);
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
MdbgCheckData(const void * ptr, const int len)
|
||||
{
|
||||
SeCheckData(SE_READ, (char *)ptr, (int)len, 1);
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
MdbgCheckString(const char * str)
|
||||
{
|
||||
SeCheckString((char *)str, 1);
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
MdbgCheckWatchPoints(void)
|
||||
{
|
||||
SeCheckWatchPoints();
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
MdbgRemoveWatchPoint(const void * ptr)
|
||||
{
|
||||
SeRemoveWatchPoint((void *)ptr);
|
||||
}
|
||||
|
||||
#else /* Sentinel */
|
||||
|
||||
inline void MdbgAddWatchPoint(const void *, const size_t) {}
|
||||
inline void MdbgChainCheck(void) {}
|
||||
inline void MdbgCheckData(const void *, const int) {}
|
||||
inline void MdbgCheckString(const char *) {}
|
||||
inline void MdbgCheckWatchPoints(void) {}
|
||||
inline void MdbgRemoveWatchPoint(const void *) {}
|
||||
|
||||
#endif /* Sentinel */
|
||||
|
||||
#endif
|
||||
31
cde/programs/dtmail/include/utils/NLS.hh
Normal file
31
cde/programs/dtmail/include/utils/NLS.hh
Normal file
@@ -0,0 +1,31 @@
|
||||
// $XConsortium: NLS.hh /main/2 1996/05/09 20:05:27 drk $
|
||||
/*
|
||||
*+SNOTICE
|
||||
*
|
||||
* RESTRICTED CONFIDENTIAL INFORMATION:
|
||||
*
|
||||
* The information in this document is subject to special
|
||||
* restrictions in a confidential disclosure agreement bertween
|
||||
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
|
||||
* document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
|
||||
* Sun's specific written approval. This documment and all copies
|
||||
* and derivative works thereof must be returned or destroyed at
|
||||
* Sun's request.
|
||||
*
|
||||
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
*+ENOTICE
|
||||
*/
|
||||
|
||||
#ifndef _NLS_HH
|
||||
#define _NLS_HH
|
||||
|
||||
char *catgets_cache2(nl_catd catd, int set, int num, char *dflt);
|
||||
|
||||
#ifdef hpV4
|
||||
# define GETMSG(catd, set_num, msg_num, def_str) catgets_cache2(catd, set_num, msg_num, def_str)
|
||||
#else
|
||||
# define GETMSG(catd, set_num, msg_num, def_str) catgets(catd, set_num, msg_num, def_str)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
29
cde/programs/dtmail/include/utils/str_utils.h
Normal file
29
cde/programs/dtmail/include/utils/str_utils.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/* $XConsortium: str_utils.h /main/1 1996/04/21 20:00:04 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1996 Hewlett-Packard Company.
|
||||
* (c) Copyright 1996 International Business Machines Corp.
|
||||
* (c) Copyright 1993-1996 Sun Microsystems, Inc.
|
||||
* (c) Copyright 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
#ifndef _STR_UTILS_H
|
||||
#define _STR_UTILS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef NEED_STRCASECMP
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _STR_UTILS_H */
|
||||
Reference in New Issue
Block a user