wmshutdown: Destroy dialog window before shutting down. This is especially useful...
[dockapps.git] / wmail / src / config.h
blobd69a6f108404f889ebec0f82fa8a5759b0aae7f5
1 ///////////////////////////////////////////////////////////////////////////////
2 // config.h
3 // configuration file parser, part of wmail
4 //
5 // Copyright 2000~2002, Sven Geisenhainer <sveng@informatik.uni-jena.de>.
6 // All rights reserved.
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions
10 // are met:
11 // 1. Redistributions of source code must retain the above copyright
12 // notice, this list of conditions, and the following disclaimer.
13 // 2. Redistributions in binary form must reproduce the above copyright
14 // notice, this list of conditions, and the following disclaimer in the
15 // documentation and/or other materials provided with the distribution.
16 // 3. The name of the author may not be used to endorse or promote products
17 // derived from this software without specific prior written permission.
19 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #ifndef _CONFIG_H_a6ebf0e22e2f5e21fc1657a8d9975e5c_
32 #define _CONFIG_H_a6ebf0e22e2f5e21fc1657a8d9975e5c_
34 typedef enum {
35 TICKER_ADDRESS = 0,
36 TICKER_FAMILYNAME = 1,
37 TICKER_NICKNAME = 2
38 } ticker_mode_t;
40 // re-allocated color-names (to enable disposing of them on reconfiguration)
41 enum {
42 SYM_COLOR = 1<<0,
43 FNT_COLOR = 1<<1,
44 BCK_COLOR = 1<<2,
45 OFF_COLOR = 1<<3,
46 BGR_COLOR = 1<<4
49 // flags to mark used cmdline options
50 enum {
51 CL_DISPLAY = 1<<0,
52 CL_MAILBOX = 1<<1,
53 CL_RUNCMD = 1<<2,
54 CL_SYMBOLCOLOR = 1<<3,
55 CL_FONTCOLOR = 1<<4,
56 CL_BACKCOLOR = 1<<5,
57 CL_OFFLIGHTCOLOR = 1<<6,
58 CL_BACKGROUNDCOLOR = 1<<7,
59 CL_CHECKSUMFILENAME = 1<<8,
60 CL_CHECKINTERVAL = 1<<9,
61 CL_FPS = 1<<10,
62 CL_NEWMAILONLY = 1<<11,
63 CL_NOSHAPE = 1<<12,
64 CL_TICKERMODE = 1<<13,
65 CL_SKIPNAMES = 1<<14,
66 CL_CMDONMAIL = 1<<15,
67 CL_CONSIDERSTATUSFIELD = 1<<16,
68 CL_READSTATUS = 1<<17,
69 CL_USEX11FONT = 1<<18
72 typedef struct _config_t {
73 char *display; // display-name
74 char *mailBox; // mailbox-name
75 char *runCmd; // command to run when the run-btn was pressed
76 char *symbolColor; // colorname of the upper-symbols while they are active
77 char *fontColor; // colorname of the ticker- and counter-digits-font
78 char *backColor; // colorname of the background
79 char *offlightColor; // colorname of inactive symbols and counter-digits
80 char *backgroundColor; // colorname of the frame when in noshape-mode
81 char *checksumFileName; // name of the checksum-file
82 int checkInterval; // sesonds between mailbox-checks
83 int fps; // ticker-frames per second
84 bool newMailsOnly; // true means only ticker and count new (unread) mail
85 bool noshape; // true means don't use shape the dockapp
86 ticker_mode_t tickerMode; // ticker senders adress, family-name or nick-name
87 char **skipNames; // sender-names that wmail has to skip
88 char *cmdOnMail; // command to execute when a new mail has received
89 bool considerStatusField; // use the status-field of the mail-header to determine its read-status
90 char *readStatus; // status field content that indicates read mails ("O" for netscape, "ro" for pine etc.)
91 char *useX11Font; // X11 font to render the ticker (NULL -> fallback to buildin font)
92 // ---------------------- //
93 int colorsUsed; // used (malloced) color-names
94 int givenOptions; // bitfield flags all options specified on the cmd-line
95 } config_t;
98 // app configuration data (declared in config.c)
99 extern config_t config;
101 // config manipulation functions
102 void ReadConfigFile( bool resetConfigStrings );
104 #endif