xref: /aoo41x/main/vcl/inc/vcl/msgbox.hxx (revision ae642d40)
10d63794cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
30d63794cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
40d63794cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
50d63794cSAndrew Rist  * distributed with this work for additional information
60d63794cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
70d63794cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
80d63794cSAndrew Rist  * "License"); you may not use this file except in compliance
90d63794cSAndrew Rist  * with the License.  You may obtain a copy of the License at
100d63794cSAndrew Rist  *
110d63794cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
120d63794cSAndrew Rist  *
130d63794cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
140d63794cSAndrew Rist  * software distributed under the License is distributed on an
150d63794cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
160d63794cSAndrew Rist  * KIND, either express or implied.  See the License for the
170d63794cSAndrew Rist  * specific language governing permissions and limitations
180d63794cSAndrew Rist  * under the License.
190d63794cSAndrew Rist  *
200d63794cSAndrew Rist  *************************************************************/
210d63794cSAndrew Rist 
220d63794cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_MSGBOX_HXX
25cdf0e10cSrcweir #define _SV_MSGBOX_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vcl/sv.h>
28cdf0e10cSrcweir #include <vcl/dllapi.h>
29cdf0e10cSrcweir #include <vcl/btndlg.hxx>
30cdf0e10cSrcweir #include <vcl/image.hxx>
31cdf0e10cSrcweir #include <vcl/bitmap.hxx>
32cdf0e10cSrcweir class FixedText;
33cdf0e10cSrcweir class FixedImage;
34cdf0e10cSrcweir class CheckBox;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir // -----------------
37cdf0e10cSrcweir // - MessBox-Types -
38cdf0e10cSrcweir // -----------------
39cdf0e10cSrcweir 
40cdf0e10cSrcweir // Return-Werte von Execute
41cdf0e10cSrcweir //!!! bei Aenderungen \basic\source\runtime\methods.cxx msgbox anpassen
42cdf0e10cSrcweir 
43cdf0e10cSrcweir #define RET_OK				 sal_True
44cdf0e10cSrcweir #define RET_CANCEL			 sal_False
45cdf0e10cSrcweir #define RET_YES 			 2
46cdf0e10cSrcweir #define RET_NO				 3
47cdf0e10cSrcweir #define RET_RETRY			 4
48cdf0e10cSrcweir #define RET_IGNORE           5
49cdf0e10cSrcweir 
50cdf0e10cSrcweir #define BUTTONID_OK 		 RET_OK
51cdf0e10cSrcweir #define BUTTONID_CANCEL 	 RET_CANCEL
52cdf0e10cSrcweir #define BUTTONID_YES		 RET_YES
53cdf0e10cSrcweir #define BUTTONID_NO 		 RET_NO
54cdf0e10cSrcweir #define BUTTONID_RETRY		 RET_RETRY
55cdf0e10cSrcweir #define BUTTONID_IGNORE      RET_IGNORE
56cdf0e10cSrcweir #define BUTTONID_HELP		 10
57cdf0e10cSrcweir 
58cdf0e10cSrcweir // -----------
59cdf0e10cSrcweir // - MessBox -
60cdf0e10cSrcweir // -----------
61cdf0e10cSrcweir 
62cdf0e10cSrcweir class VCL_DLLPUBLIC MessBox : public ButtonDialog
63cdf0e10cSrcweir {
64cdf0e10cSrcweir protected:
65cdf0e10cSrcweir 	FixedText*			mpFixedText;
66cdf0e10cSrcweir 	FixedImage* 		mpFixedImage;
67cdf0e10cSrcweir 	XubString			maMessText;
68cdf0e10cSrcweir 	Image				maImage;
69cdf0e10cSrcweir 	Image				maImageHC;
70cdf0e10cSrcweir 	sal_uInt16				mnSoundType;
71cdf0e10cSrcweir 	sal_Bool				mbHelpBtn;
72cdf0e10cSrcweir 	sal_Bool				mbSound;
73cdf0e10cSrcweir     CheckBox*           mpCheckBox;
74cdf0e10cSrcweir     XubString           maCheckBoxText;
75cdf0e10cSrcweir     sal_Bool                mbCheck;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 	SAL_DLLPRIVATE void	ImplInitMessBoxData();
78cdf0e10cSrcweir 	SAL_DLLPRIVATE void	ImplInitButtons();
79cdf0e10cSrcweir 	SAL_DLLPRIVATE void	ImplPosControls();
80cdf0e10cSrcweir 
81cdf0e10cSrcweir protected:
82cdf0e10cSrcweir 	SAL_DLLPRIVATE void	ImplLoadRes( const ResId& rResId );
83cdf0e10cSrcweir 						MessBox( WindowType nType );
84cdf0e10cSrcweir 
85cdf0e10cSrcweir public:
86cdf0e10cSrcweir 						MessBox( Window* pParent, WinBits nStyle,
87cdf0e10cSrcweir 								 const XubString& rTitle, const XubString& rMessage );
88cdf0e10cSrcweir 						MessBox( Window* pParent, const ResId& rResId );
89cdf0e10cSrcweir 						~MessBox();
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 	virtual void		StateChanged( StateChangedType nStateChange );
92cdf0e10cSrcweir 
SetMessText(const XubString & rText)93cdf0e10cSrcweir 	void				SetMessText( const XubString& rText ) { maMessText = rText; }
GetMessText() const94cdf0e10cSrcweir 	const XubString& 	GetMessText() const { return maMessText; }
95cdf0e10cSrcweir 
SetImage(const Image & rImage)96cdf0e10cSrcweir 	void				SetImage( const Image& rImage ) { maImage = rImage; }
GetImage() const97cdf0e10cSrcweir 	const Image&		GetImage() const { return maImage; }
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     sal_Bool                SetModeImage( const Image& rImage, BmpColorMode eMode = BMP_COLOR_NORMAL );
100cdf0e10cSrcweir     const Image&        GetModeImage( BmpColorMode eMode = BMP_COLOR_NORMAL ) const;
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     void                SetDefaultCheckBoxText();
SetCheckBoxText(const XubString & rText)103cdf0e10cSrcweir     void                SetCheckBoxText( const XubString& rText ) { maCheckBoxText = rText;}
GetCheckBoxText() const104cdf0e10cSrcweir     const XubString&    GetCheckBoxText() const { return maCheckBoxText;}
105cdf0e10cSrcweir     void                SetCheckBoxState( sal_Bool bCheck );
106cdf0e10cSrcweir     sal_Bool                GetCheckBoxState() const;
107cdf0e10cSrcweir 
108cdf0e10cSrcweir     virtual Size        GetOptimalSize(WindowSizeType eType) const;
109cdf0e10cSrcweir };
110cdf0e10cSrcweir 
111cdf0e10cSrcweir // -----------
112cdf0e10cSrcweir // - InfoBox -
113cdf0e10cSrcweir // -----------
114cdf0e10cSrcweir 
115cdf0e10cSrcweir class VCL_DLLPUBLIC InfoBox : public MessBox
116cdf0e10cSrcweir {
117cdf0e10cSrcweir private:
118cdf0e10cSrcweir 	SAL_DLLPRIVATE void	ImplInitInfoBoxData();
119cdf0e10cSrcweir 
120cdf0e10cSrcweir public:
121cdf0e10cSrcweir 						InfoBox( Window* pParent, const XubString& rMessage );
122cdf0e10cSrcweir 						InfoBox( Window* pParent, const ResId & rResId );
123*ae642d40SHerbert Dürr 						InfoBox( Window* pParent, WinBits nStyle,
124*ae642d40SHerbert Dürr                                 const XubString& rMessage );
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 	static Image		GetStandardImage();
127cdf0e10cSrcweir 	static Image		GetStandardImageHC();
128cdf0e10cSrcweir };
129cdf0e10cSrcweir 
130cdf0e10cSrcweir // --------------
131cdf0e10cSrcweir // - WarningBox -
132cdf0e10cSrcweir // --------------
133cdf0e10cSrcweir 
134cdf0e10cSrcweir class VCL_DLLPUBLIC WarningBox : public MessBox
135cdf0e10cSrcweir {
136cdf0e10cSrcweir private:
137cdf0e10cSrcweir 	SAL_DLLPRIVATE void	ImplInitWarningBoxData();
138cdf0e10cSrcweir 
139cdf0e10cSrcweir public:
140cdf0e10cSrcweir 						WarningBox( Window* pParent, WinBits nStyle,
141cdf0e10cSrcweir 									const XubString& rMessage );
142cdf0e10cSrcweir 						WarningBox( Window* pParent, const ResId& rResId );
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     void                SetDefaultCheckBoxText();
145cdf0e10cSrcweir 
146cdf0e10cSrcweir 	static Image		GetStandardImage();
147cdf0e10cSrcweir 	static Image		GetStandardImageHC();
148cdf0e10cSrcweir };
149cdf0e10cSrcweir 
150cdf0e10cSrcweir // ------------
151cdf0e10cSrcweir // - ErrorBox -
152cdf0e10cSrcweir // ------------
153cdf0e10cSrcweir 
154cdf0e10cSrcweir class VCL_DLLPUBLIC ErrorBox : public MessBox
155cdf0e10cSrcweir {
156cdf0e10cSrcweir private:
157cdf0e10cSrcweir 	SAL_DLLPRIVATE void	ImplInitErrorBoxData();
158cdf0e10cSrcweir 
159cdf0e10cSrcweir public:
160cdf0e10cSrcweir 						ErrorBox( Window* pParent, WinBits nStyle,
161cdf0e10cSrcweir 								  const XubString& rMessage );
162cdf0e10cSrcweir 						ErrorBox( Window* pParent, const ResId& rResId );
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 	static Image		GetStandardImage();
165cdf0e10cSrcweir 	static Image		GetStandardImageHC();
166cdf0e10cSrcweir };
167cdf0e10cSrcweir 
168cdf0e10cSrcweir // ------------
169cdf0e10cSrcweir // - QueryBox -
170cdf0e10cSrcweir // ------------
171cdf0e10cSrcweir 
172cdf0e10cSrcweir class VCL_DLLPUBLIC QueryBox : public MessBox
173cdf0e10cSrcweir {
174cdf0e10cSrcweir private:
175cdf0e10cSrcweir 	SAL_DLLPRIVATE void	ImplInitQueryBoxData();
176cdf0e10cSrcweir 
177cdf0e10cSrcweir public:
178cdf0e10cSrcweir 						QueryBox( Window* pParent, WinBits nStyle,
179cdf0e10cSrcweir 								  const XubString& rMessage );
180cdf0e10cSrcweir 						QueryBox( Window* pParent, const ResId& rResId );
181cdf0e10cSrcweir 
182cdf0e10cSrcweir     void                SetDefaultCheckBoxText();
183cdf0e10cSrcweir 
184cdf0e10cSrcweir 	static Image		GetStandardImage();
185cdf0e10cSrcweir 	static Image		GetStandardImageHC();
186cdf0e10cSrcweir };
187cdf0e10cSrcweir 
188cdf0e10cSrcweir #endif	// _SV_MSGBOX_HXX
189