Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtprintinfo / UI / DtApp.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: DtApp.h /main/3 1995/11/06 09:34:32 rswiston $ */
24 /*                                                                      *
25  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
26  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
27  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
28  * (c) Copyright 1993, 1994 Novell, Inc.                                *
29  */
30
31 #ifndef DTAPP_H
32 #define DTAPP_H
33
34 #include "Application.h"
35 #include "DtPrinterIcon.h"
36 #include "DtSetPref.h"
37
38 class DtMainW;
39 class BaseObj;
40 class DtPrtJobIcon;
41
42 extern const char *PROPERTY;
43 extern const char *HELP;
44 extern const char *FIND;
45 extern const char *EXIT;
46 extern const char *HIDE;
47 extern const char *RENAME;
48 extern const char *OPEN;
49 extern const char *CLOSE;
50 extern const char *PRINTERS_DIR;
51
52 class DtApp : public Application
53 {
54
55    friend void InitQueueDetails(BaseUI *obj, void *data);
56    friend void RemoteStatusCB(BaseUI *obj, char *output, int rc);
57    friend void TurnOffHourGlass(BaseUI *obj, void *data);
58    friend void OpenClose(void *data, BaseUI *obj);
59    friend void ActionCB(void *data, BaseUI *obj, char *actionReferenceName);
60    friend void UpdatePrintJobs(BaseUI *obj, void *data);
61    friend void PreferenceCB(void *data, PreferenceRequest req, char *value);
62    friend void FilterCB(void *data);
63    friend void ModifyCB(void *data);
64    friend boolean SelectPrintJobs(BaseUI *obj);
65    friend void FindCB(void *data);
66    friend void AddQueues(BaseUI *obj, void *data);
67    friend void RestoreAppCB(BaseUI *obj, void *data);
68
69  private:
70
71    static void InitQueueDetails(BaseUI *obj, void *data);
72    static void RemoteStatusCB(BaseUI *obj, char *output, int rc);
73    static void TurnOffHourGlass(BaseUI *obj, void *data);
74    static void OpenClose(void *data, BaseUI *obj);
75    static void ActionCB(void *data, BaseUI *obj, char *actionReferenceName);
76    static void UpdatePrintJobs(BaseUI *obj, void *data);
77    static void PreferenceCB(void *data, PreferenceRequest req, char *value);
78    static void FilterCB(void *data);
79    static void ModifyCB(void *data);
80    static boolean SelectPrintJobs(BaseUI *obj);
81    static void FindCB(void *data);
82    static void AddQueues(BaseUI *obj, void *data);
83    static void RestoreAppCB(BaseUI *obj, void *data);
84
85    void OpenClose(BaseUI *obj);
86    void PreferenceCB(PreferenceRequest req, char *value);
87    void FilterCB(BaseUI *container);
88    void UpdateStatusLine();
89    void UpdateQueues();
90    void RestoreApp();
91    void AddActions(BaseObj *dummy);
92    void ShowStatusDialog(DtPrinterIcon *);
93    void HandleShowDetailsLabelPreferenceRequest(IconStyle style);
94    void HandleDetailsPreferenceRequest(boolean details_on);
95    boolean ShowUserJob(DtPrtJobIcon *_job, char *user_name);
96    void ShowUserJobs(BaseUI *queue, char *user_name, boolean flag);
97    void HandleShowOnlyMinePreferenceRequest(boolean flag);
98
99    int connect_timeout; // connect timeout to contact server
100    long Frequency;
101    char *old_dbsearchpath;
102    boolean save_state;
103
104  public:
105
106    int old_uid;
107    PrinterApplicationMode app_mode;
108    DtPrinterIcon *single_printer;
109    DtMainW *window;
110    char *printer_dir;
111    char *lang;
112    char *home;
113
114    DtApp(char *progname, int *argc, char **argv);
115    ~DtApp();
116    void SaveYourSelf();
117    char *SessionFile();
118    char *SessionPath() { return printer_dir; }
119    char *GetBottomString(BaseObj *job, boolean need_details);
120    void ActionCB(BaseUI *obj, char *actionReferenceName);
121
122 };
123
124
125
126 #endif // DTAPP_H