update dev300-m58
[ooovba.git] / svx / source / cui / dlgname.hxx
blobcd13055a40d87f5055af9cf49fe9870e9d63069c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dlgname.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SVX_DLG_NAME_HXX
31 #define _SVX_DLG_NAME_HXX
34 #ifndef _EDIT_HXX //autogen
35 #include <vcl/edit.hxx>
36 #endif
37 #ifndef _BUTTON_HXX //autogen
38 #include <vcl/button.hxx>
39 #endif
40 #ifndef _FIXED_HXX //autogen
41 #include <vcl/fixed.hxx>
42 #endif
43 #ifndef _DIALOG_HXX //autogen
44 #include <vcl/dialog.hxx>
45 #endif
46 #include <vcl/fixed.hxx>
48 // #i68101#
49 #include <svtools/svmedit.hxx>
51 /*************************************************************************
53 |* Dialog zum Editieren eines Namens
55 \************************************************************************/
56 class SvxNameDialog : public ModalDialog
58 private:
59 FixedText aFtDescription;
60 Edit aEdtName;
61 OKButton aBtnOK;
62 CancelButton aBtnCancel;
63 HelpButton aBtnHelp;
65 Link aCheckNameHdl;
66 #if _SOLAR__PRIVATE
67 DECL_LINK(ModifyHdl, Edit*);
68 #endif
70 public:
71 SvxNameDialog( Window* pWindow, const String& rName, const String& rDesc );
73 void GetName( String& rName ){rName = aEdtName.GetText();}
75 /** add a callback Link that is called whenever the content of the edit
76 field is changed. The Link result determines wether the OK
77 Button is enabled (> 0) or disabled (== 0).
79 @param rLink a Callback declared with DECL_LINK and implemented with
80 IMPL_LINK, that is executed on modification.
82 @param bCheckImmediately If true, the Link is called directly after
83 setting it. It is recommended to set this flag to true to avoid
84 an inconsistent state if the initial String (given in the CTOR)
85 does not satisfy the check condition.
87 @todo Remove the parameter bCheckImmediately and incorporate the 'true'
88 behaviour as default.
90 void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false )
92 aCheckNameHdl = rLink;
93 if ( bCheckImmediately )
94 aBtnOK.Enable( rLink.Call( this ) > 0 );
97 void SetEditHelpId(ULONG nHelpId) {aEdtName.SetHelpId(nHelpId);}
100 ///////////////////////////////////////////////////////////////////////////////////////////////
101 // #i68101#
102 // Dialog for editing Object Title and Description
103 // plus uniqueness-callback-linkHandler
105 class SvxObjectNameDialog : public ModalDialog
107 private:
108 // name
109 FixedText aFtName;
110 Edit aEdtName;
112 // separator
113 FixedLine aFlSeparator;
115 // buttons
116 HelpButton aBtnHelp;
117 OKButton aBtnOK;
118 CancelButton aBtnCancel;
120 // callback link for name uniqueness
121 Link aCheckNameHdl;
122 #if _SOLAR__PRIVATE
123 DECL_LINK(ModifyHdl, Edit*);
124 #endif
126 public:
127 // constructor
128 SvxObjectNameDialog(Window* pWindow, const String& rName);
130 // data access
131 void GetName(String& rName) {rName = aEdtName.GetText(); }
133 // set handler
134 void SetCheckNameHdl(const Link& rLink, bool bCheckImmediately = false)
136 aCheckNameHdl = rLink;
138 if(bCheckImmediately)
140 aBtnOK.Enable(rLink.Call(this) > 0);
145 ///////////////////////////////////////////////////////////////////////////////////////////////
146 // #i68101#
147 // Dialog for editing Object Title and Description
149 class SvxObjectTitleDescDialog : public ModalDialog
151 private:
152 // title
153 FixedText aFtTitle;
154 Edit aEdtTitle;
156 // description
157 FixedText aFtDescription;
158 MultiLineEdit aEdtDescription;
160 // separator
161 FixedLine aFlSeparator;
163 // buttons
164 HelpButton aBtnHelp;
165 OKButton aBtnOK;
166 CancelButton aBtnCancel;
168 public:
169 // constructor
170 SvxObjectTitleDescDialog(Window* pWindow, const String& rTitle, const String& rDesc);
172 // data access
173 void GetTitle(String& rTitle) {rTitle = aEdtTitle.GetText(); }
174 void GetDescription(String& rDescription) {rDescription = aEdtDescription.GetText(); }
177 ///////////////////////////////////////////////////////////////////////////////////////////////
179 /*************************************************************************
181 |* Dialog zum Abbrechen, Speichern oder Hinzufuegen
183 \************************************************************************/
184 class SvxMessDialog : public ModalDialog
186 private:
187 FixedText aFtDescription;
188 PushButton aBtn1;
189 PushButton aBtn2;
190 CancelButton aBtnCancel;
191 FixedImage aFtImage;
192 Image* pImage;
193 #if _SOLAR__PRIVATE
194 DECL_LINK( Button1Hdl, Button * );
195 DECL_LINK( Button2Hdl, Button * );
196 #endif
197 public:
198 SvxMessDialog( Window* pWindow, const String& rText, const String& rDesc, Image* pImg = NULL );
199 ~SvxMessDialog();
201 void SetButtonText( USHORT nBtnId, const String& rNewTxt );
206 #endif // _SVX_DLG_NAME_HXX