1*c4eee24dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*c4eee24dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*c4eee24dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*c4eee24dSAndrew Rist * distributed with this work for additional information 6*c4eee24dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*c4eee24dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*c4eee24dSAndrew Rist * "License"); you may not use this file except in compliance 9*c4eee24dSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*c4eee24dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*c4eee24dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*c4eee24dSAndrew Rist * software distributed under the License is distributed on an 15*c4eee24dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*c4eee24dSAndrew Rist * KIND, either express or implied. See the License for the 17*c4eee24dSAndrew Rist * specific language governing permissions and limitations 18*c4eee24dSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*c4eee24dSAndrew Rist *************************************************************/ 21*c4eee24dSAndrew Rist 22*c4eee24dSAndrew Rist 23cdf0e10cSrcweir #ifndef _SVX_DLG_NAME_HXX 24cdf0e10cSrcweir #define _SVX_DLG_NAME_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef _EDIT_HXX //autogen 28cdf0e10cSrcweir #include <vcl/edit.hxx> 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir #ifndef _BUTTON_HXX //autogen 31cdf0e10cSrcweir #include <vcl/button.hxx> 32cdf0e10cSrcweir #endif 33cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen 34cdf0e10cSrcweir #include <vcl/fixed.hxx> 35cdf0e10cSrcweir #endif 36cdf0e10cSrcweir #ifndef _DIALOG_HXX //autogen 37cdf0e10cSrcweir #include <vcl/dialog.hxx> 38cdf0e10cSrcweir #endif 39cdf0e10cSrcweir #include <vcl/fixed.hxx> 40cdf0e10cSrcweir 41cdf0e10cSrcweir // #i68101# 42cdf0e10cSrcweir #include <svtools/svmedit.hxx> 43cdf0e10cSrcweir 44cdf0e10cSrcweir /************************************************************************* 45cdf0e10cSrcweir |* 46cdf0e10cSrcweir |* Dialog zum Editieren eines Namens 47cdf0e10cSrcweir |* 48cdf0e10cSrcweir \************************************************************************/ 49cdf0e10cSrcweir class SvxNameDialog : public ModalDialog 50cdf0e10cSrcweir { 51cdf0e10cSrcweir private: 52cdf0e10cSrcweir FixedText aFtDescription; 53cdf0e10cSrcweir Edit aEdtName; 54cdf0e10cSrcweir OKButton aBtnOK; 55cdf0e10cSrcweir CancelButton aBtnCancel; 56cdf0e10cSrcweir HelpButton aBtnHelp; 57cdf0e10cSrcweir 58cdf0e10cSrcweir Link aCheckNameHdl; 59cdf0e10cSrcweir #if _SOLAR__PRIVATE 60cdf0e10cSrcweir DECL_LINK(ModifyHdl, Edit*); 61cdf0e10cSrcweir #endif 62cdf0e10cSrcweir 63cdf0e10cSrcweir public: 64cdf0e10cSrcweir SvxNameDialog( Window* pWindow, const String& rName, const String& rDesc ); 65cdf0e10cSrcweir GetName(String & rName)66cdf0e10cSrcweir void GetName( String& rName ){rName = aEdtName.GetText();} 67cdf0e10cSrcweir 68cdf0e10cSrcweir /** add a callback Link that is called whenever the content of the edit 69cdf0e10cSrcweir field is changed. The Link result determines wether the OK 70cdf0e10cSrcweir Button is enabled (> 0) or disabled (== 0). 71cdf0e10cSrcweir 72cdf0e10cSrcweir @param rLink a Callback declared with DECL_LINK and implemented with 73cdf0e10cSrcweir IMPL_LINK, that is executed on modification. 74cdf0e10cSrcweir 75cdf0e10cSrcweir @param bCheckImmediately If true, the Link is called directly after 76cdf0e10cSrcweir setting it. It is recommended to set this flag to true to avoid 77cdf0e10cSrcweir an inconsistent state if the initial String (given in the CTOR) 78cdf0e10cSrcweir does not satisfy the check condition. 79cdf0e10cSrcweir 80cdf0e10cSrcweir @todo Remove the parameter bCheckImmediately and incorporate the 'true' 81cdf0e10cSrcweir behaviour as default. 82cdf0e10cSrcweir */ SetCheckNameHdl(const Link & rLink,bool bCheckImmediately=false)83cdf0e10cSrcweir void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false ) 84cdf0e10cSrcweir { 85cdf0e10cSrcweir aCheckNameHdl = rLink; 86cdf0e10cSrcweir if ( bCheckImmediately ) 87cdf0e10cSrcweir aBtnOK.Enable( rLink.Call( this ) > 0 ); 88cdf0e10cSrcweir } 89cdf0e10cSrcweir SetEditHelpId(const rtl::OString & aHelpId)90cdf0e10cSrcweir void SetEditHelpId( const rtl::OString& aHelpId) {aEdtName.SetHelpId(aHelpId);} 91cdf0e10cSrcweir }; 92cdf0e10cSrcweir 93cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////////////////////////// 94cdf0e10cSrcweir // #i68101# 95cdf0e10cSrcweir // Dialog for editing Object Title and Description 96cdf0e10cSrcweir // plus uniqueness-callback-linkHandler 97cdf0e10cSrcweir 98cdf0e10cSrcweir class SvxObjectNameDialog : public ModalDialog 99cdf0e10cSrcweir { 100cdf0e10cSrcweir private: 101cdf0e10cSrcweir // name 102cdf0e10cSrcweir FixedText aFtName; 103cdf0e10cSrcweir Edit aEdtName; 104cdf0e10cSrcweir 105cdf0e10cSrcweir // separator 106cdf0e10cSrcweir FixedLine aFlSeparator; 107cdf0e10cSrcweir 108cdf0e10cSrcweir // buttons 109cdf0e10cSrcweir HelpButton aBtnHelp; 110cdf0e10cSrcweir OKButton aBtnOK; 111cdf0e10cSrcweir CancelButton aBtnCancel; 112cdf0e10cSrcweir 113cdf0e10cSrcweir // callback link for name uniqueness 114cdf0e10cSrcweir Link aCheckNameHdl; 115cdf0e10cSrcweir #if _SOLAR__PRIVATE 116cdf0e10cSrcweir DECL_LINK(ModifyHdl, Edit*); 117cdf0e10cSrcweir #endif 118cdf0e10cSrcweir 119cdf0e10cSrcweir public: 120cdf0e10cSrcweir // constructor 121cdf0e10cSrcweir SvxObjectNameDialog(Window* pWindow, const String& rName); 122cdf0e10cSrcweir 123cdf0e10cSrcweir // data access GetName(String & rName)124cdf0e10cSrcweir void GetName(String& rName) {rName = aEdtName.GetText(); } 125cdf0e10cSrcweir 126cdf0e10cSrcweir // set handler SetCheckNameHdl(const Link & rLink,bool bCheckImmediately=false)127cdf0e10cSrcweir void SetCheckNameHdl(const Link& rLink, bool bCheckImmediately = false) 128cdf0e10cSrcweir { 129cdf0e10cSrcweir aCheckNameHdl = rLink; 130cdf0e10cSrcweir 131cdf0e10cSrcweir if(bCheckImmediately) 132cdf0e10cSrcweir { 133cdf0e10cSrcweir aBtnOK.Enable(rLink.Call(this) > 0); 134cdf0e10cSrcweir } 135cdf0e10cSrcweir } 136cdf0e10cSrcweir }; 137cdf0e10cSrcweir 138cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////////////////////////// 139cdf0e10cSrcweir // #i68101# 140cdf0e10cSrcweir // Dialog for editing Object Title and Description 141cdf0e10cSrcweir 142cdf0e10cSrcweir class SvxObjectTitleDescDialog : public ModalDialog 143cdf0e10cSrcweir { 144cdf0e10cSrcweir private: 145cdf0e10cSrcweir // title 146cdf0e10cSrcweir FixedText aFtTitle; 147cdf0e10cSrcweir Edit aEdtTitle; 148cdf0e10cSrcweir 149cdf0e10cSrcweir // description 150cdf0e10cSrcweir FixedText aFtDescription; 151cdf0e10cSrcweir MultiLineEdit aEdtDescription; 152cdf0e10cSrcweir 153cdf0e10cSrcweir // separator 154cdf0e10cSrcweir FixedLine aFlSeparator; 155cdf0e10cSrcweir 156cdf0e10cSrcweir // buttons 157cdf0e10cSrcweir HelpButton aBtnHelp; 158cdf0e10cSrcweir OKButton aBtnOK; 159cdf0e10cSrcweir CancelButton aBtnCancel; 160cdf0e10cSrcweir 161cdf0e10cSrcweir public: 162cdf0e10cSrcweir // constructor 163cdf0e10cSrcweir SvxObjectTitleDescDialog(Window* pWindow, const String& rTitle, const String& rDesc); 164cdf0e10cSrcweir 165cdf0e10cSrcweir // data access GetTitle(String & rTitle)166cdf0e10cSrcweir void GetTitle(String& rTitle) {rTitle = aEdtTitle.GetText(); } GetDescription(String & rDescription)167cdf0e10cSrcweir void GetDescription(String& rDescription) {rDescription = aEdtDescription.GetText(); } 168cdf0e10cSrcweir }; 169cdf0e10cSrcweir 170cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////////////////////////// 171cdf0e10cSrcweir 172cdf0e10cSrcweir /************************************************************************* 173cdf0e10cSrcweir |* 174cdf0e10cSrcweir |* Dialog zum Abbrechen, Speichern oder Hinzufuegen 175cdf0e10cSrcweir |* 176cdf0e10cSrcweir \************************************************************************/ 177cdf0e10cSrcweir class SvxMessDialog : public ModalDialog 178cdf0e10cSrcweir { 179cdf0e10cSrcweir private: 180cdf0e10cSrcweir FixedText aFtDescription; 181cdf0e10cSrcweir PushButton aBtn1; 182cdf0e10cSrcweir PushButton aBtn2; 183cdf0e10cSrcweir CancelButton aBtnCancel; 184cdf0e10cSrcweir FixedImage aFtImage; 185cdf0e10cSrcweir Image* pImage; 186cdf0e10cSrcweir #if _SOLAR__PRIVATE 187cdf0e10cSrcweir DECL_LINK( Button1Hdl, Button * ); 188cdf0e10cSrcweir DECL_LINK( Button2Hdl, Button * ); 189cdf0e10cSrcweir #endif 190cdf0e10cSrcweir public: 191cdf0e10cSrcweir SvxMessDialog( Window* pWindow, const String& rText, const String& rDesc, Image* pImg = NULL ); 192cdf0e10cSrcweir ~SvxMessDialog(); 193cdf0e10cSrcweir 194cdf0e10cSrcweir void SetButtonText( sal_uInt16 nBtnId, const String& rNewTxt ); 195cdf0e10cSrcweir }; 196cdf0e10cSrcweir 197cdf0e10cSrcweir 198cdf0e10cSrcweir 199cdf0e10cSrcweir #endif // _SVX_DLG_NAME_HXX 200cdf0e10cSrcweir 201