]> git.sesse.net Git - vlc/blob - modules/gui/win32/preferences.h
00a838c7bfbd2efd538472ad3e84f5ea03a0c400
[vlc] / modules / gui / win32 / preferences.h
1 /*****************************************************************************\r
2  * preferences.h: the "Preferences" dialog box\r
3  *****************************************************************************\r
4  * Copyright (C) 2002-2003 VideoLAN\r
5  *\r
6  * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>\r
7  *          Boris Dores <babal@via.ecp.fr>\r
8  *\r
9  * This program is free software; you can redistribute it and/or modify\r
10  * it under the terms of the GNU General Public License as published by\r
11  * the Free Software Foundation; either version 2 of the License, or\r
12  * (at your option) any later version.\r
13  *\r
14  * This program is distributed in the hope that it will be useful,\r
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
17  * GNU General Public License for more details.\r
18  *\r
19  * You should have received a copy of the GNU General Public License\r
20  * along with this program; if not, write to the Free Software\r
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
22  *****************************************************************************/\r
23 \r
24 #ifndef preferencesH\r
25 #define preferencesH\r
26 //---------------------------------------------------------------------------\r
27 #include <Classes.hpp>\r
28 #include <Controls.hpp>\r
29 #include <StdCtrls.hpp>\r
30 #include <Forms.hpp>\r
31 #include <Buttons.hpp>\r
32 #include <ComCtrls.hpp>\r
33 #include <CheckLst.hpp>\r
34 #include <ExtCtrls.hpp>\r
35 #include "CSPIN.h"\r
36 //---------------------------------------------------------------------------\r
37 /* A TCheckListBox that automatically disposes any TObject\r
38    associated with the string items */\r
39 class TCleanCheckListBox : public TCheckListBox\r
40 {\r
41 public:\r
42     __fastcall TCleanCheckListBox( Classes::TComponent* AOwner )\r
43         : TCheckListBox( AOwner ) {};\r
44     virtual __fastcall ~TCleanCheckListBox();\r
45 };\r
46 //---------------------------------------------------------------------------\r
47 /* A THintWindow with a limited width */\r
48 class TNarrowHintWindow : public THintWindow\r
49 {\r
50 public:\r
51    virtual void __fastcall ActivateHint( const Windows::TRect &Rect,\r
52        const System::AnsiString AHint );\r
53 };\r
54 //---------------------------------------------------------------------------\r
55 /* Just a wrapper to embed an AnsiString into a TObject */\r
56 class TObjectString : public TObject\r
57 {\r
58 private:\r
59     AnsiString FString;\r
60 public:\r
61     __fastcall TObjectString( char * String );\r
62     AnsiString __fastcall String();\r
63 };\r
64 //---------------------------------------------------------------------------\r
65 class TPanelPref : public TPanel\r
66 {\r
67 public:\r
68     __fastcall TPanelPref( TComponent* Owner, module_config_t *_p_config,\r
69             intf_thread_t *_p_intf );\r
70     virtual void __fastcall UpdateChanges() = 0;\r
71 protected:\r
72     module_config_t * p_config;\r
73     intf_thread_t * p_intf;\r
74     TCleanCheckListBox * __fastcall CreateCleanCheckListBox(TWinControl *Parent,\r
75             int Left, int Width, int Top, int Height );\r
76     TButton * __fastcall CreateButton( TWinControl *Parent,\r
77             int Left, int Width, int Top, int Height, AnsiString Caption );\r
78     TCheckBox * __fastcall CreateCheckBox( TWinControl *Parent,\r
79             int Left, int Width, int Top, int Height, AnsiString Caption );\r
80     TLabel * __fastcall CreateLabel( TWinControl *Parent,\r
81             int Left, int Width, int Top, int Height, AnsiString Caption,\r
82             bool WordWrap );\r
83     TEdit * __fastcall CreateEdit( TWinControl *Parent,\r
84             int Left, int Width, int Top, int Height, AnsiString Text );\r
85     TCSpinEdit * __fastcall CreateSpinEdit( TWinControl *Parent,\r
86             int Left, int Width, int Top, int Height,\r
87             long Min, long Max, long Value );\r
88 };\r
89 //---------------------------------------------------------------------------\r
90 class TPanelPlugin : public TPanelPref\r
91 {\r
92 public:\r
93     __fastcall TPanelPlugin( TComponent* Owner, module_config_t *p_config,\r
94             intf_thread_t *_p_intf, bool b_multi_plugins );\r
95     bool b_multi_plugins;\r
96     TCleanCheckListBox *CleanCheckListBox;\r
97     TButton *ButtonConfig;\r
98     TButton *ButtonUp;\r
99     TButton *ButtonDown;\r
100     TLabel *Label;\r
101     module_t *ModuleSelected;\r
102     virtual void __fastcall TPanelPlugin::SetValue ( AnsiString Values );\r
103     virtual void __fastcall UpdateChanges();\r
104     void __fastcall CheckListBoxClick( TObject *Sender );\r
105     void __fastcall CheckListBoxClickCheck( TObject *Sender );\r
106     void __fastcall ButtonConfigClick( TObject *Sender );\r
107     void __fastcall ButtonUpClick( TObject *Sender );\r
108     void __fastcall ButtonDownClick( TObject *Sender );\r
109 };\r
110 //---------------------------------------------------------------------------\r
111 class TPanelString : public TPanelPref\r
112 {\r
113 public:\r
114     __fastcall TPanelString( TComponent* Owner, module_config_t *p_config,\r
115             intf_thread_t *_p_intf );\r
116     TLabel *Label;\r
117     TEdit *Edit;\r
118     virtual void __fastcall UpdateChanges();\r
119 };\r
120 //---------------------------------------------------------------------------\r
121 class TPanelInteger : public TPanelPref\r
122 {\r
123 public:\r
124     __fastcall TPanelInteger( TComponent* Owner, module_config_t *p_config,\r
125             intf_thread_t *_p_intf );\r
126     TLabel *Label;\r
127     TCSpinEdit *SpinEdit;\r
128     virtual void __fastcall UpdateChanges();\r
129 };\r
130 //---------------------------------------------------------------------------\r
131 class TPanelFloat : public TPanelPref\r
132 {\r
133 public:\r
134     __fastcall TPanelFloat( TComponent* Owner, module_config_t *p_config,\r
135             intf_thread_t *_p_intf );\r
136     TLabel *Label;\r
137     TEdit *Edit;\r
138     virtual void __fastcall UpdateChanges();\r
139 };\r
140 //---------------------------------------------------------------------------\r
141 class TPanelBool : public TPanelPref\r
142 {\r
143 public:\r
144     __fastcall TPanelBool( TComponent* Owner, module_config_t *p_config,\r
145             intf_thread_t *_p_intf );\r
146     TCheckBox *CheckBox;\r
147     virtual void __fastcall UpdateChanges();\r
148 };\r
149 //---------------------------------------------------------------------------\r
150 class TPreferencesDlg : public TForm\r
151 {\r
152 __published:    // IDE-managed Components\r
153     TPageControl *PageControlPref;\r
154     TButton *ButtonApply;\r
155     TButton *ButtonSave;\r
156     TButton *ButtonOK;\r
157     TButton *ButtonCancel;\r
158     void __fastcall ButtonOkClick( TObject *Sender );\r
159     void __fastcall ButtonApplyClick( TObject *Sender );\r
160     void __fastcall ButtonSaveClick( TObject *Sender );\r
161     void __fastcall ButtonCancelClick( TObject *Sender );\r
162     void __fastcall FormClose( TObject *Sender, TCloseAction &Action );\r
163 private:        // User declarations\r
164     intf_thread_t *p_intf;\r
165 public:         // User declarations\r
166     __fastcall TPreferencesDlg( TComponent* Owner, intf_thread_t *_p_intf );\r
167     void __fastcall CreateConfigDialog( char *psz_module_name );\r
168 };\r
169 //---------------------------------------------------------------------------\r
170 #endif\r