Fix typo in license headers
[oweals/cde.git] / cde / programs / dtmail / include / DtMail / PropSource.hh
1 /* $TOG: PropSource.hh /main/6 1997/11/13 13:26:08 mgreess $ */
2 /*
3  *+SNOTICE
4  *
5  *      RESTRICTED CONFIDENTIAL INFORMATION:
6  *      
7  *      The information in this document is subject to special
8  *      restrictions in a confidential disclosure agreement bertween
9  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
10  *      document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
11  *      Sun's specific written approval.  This documment and all copies
12  *      and derivative works thereof must be returned or destroyed at
13  *      Sun's request.
14  *
15  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
16  *
17  *+ENOTICE
18  */
19
20 #include "DtMail.hh"
21 #include <DtMail/DtMailTypes.h>
22 #include <DtMail/DtVirtArray.hh>
23
24 #ifndef _PROPSOURCE_HH
25 #define _PROPSOURCE_HH
26
27 struct PropDefaults {
28     const char *        key;
29     const char *        value;
30 };
31
32 // Virtual class is base class for props data accessing funcs
33 ////////////////////////////////////////////////////////////////
34 class PropSource
35 {
36 public:
37
38 #define PropSourceDEFAULTVALUE  " "
39
40   PropSource(DtMail::MailRc *m_rc,  char *key);
41   virtual ~PropSource();
42
43   virtual const char    *getValue(DtMailBoolean decrypt = DTM_FALSE) = 0;
44   virtual void           setValue(char*, DtMailBoolean encrypt=DTM_FALSE) = 0;
45
46   static void            setDefaultValue(char *key, char *value);
47   virtual const char    *getDefaultValue(void);
48   virtual DtMail::MailRc *getMailRc(void) { return _mail_rc; };
49
50 protected:
51   
52   char                  *_key; // just a pointer NOT our memory
53   DtMail::MailRc        *_mail_rc;
54   static DtVirtArray<PropDefaults*>
55                         *_dynamic_defaults;
56
57 };
58
59
60 // Accesses the mailrc hash tables...
61 /////////////////////////////////////////////////////////////////
62
63 class MailRcSource : public PropSource {
64
65 public:
66   
67   MailRcSource(DtMail::MailRc *m_rc, char *key) : PropSource(m_rc, key) {;};
68   virtual ~MailRcSource() {;}
69
70   virtual const char *getValue(DtMailBoolean decrypt = DTM_FALSE);
71   virtual void setValue(char *value, DtMailBoolean encrypt = DTM_TRUE);
72
73 private:
74 };
75
76 #endif