1*353d8f4dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*353d8f4dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*353d8f4dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*353d8f4dSAndrew Rist * distributed with this work for additional information 6*353d8f4dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*353d8f4dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*353d8f4dSAndrew Rist * "License"); you may not use this file except in compliance 9*353d8f4dSAndrew Rist * with the License. You may obtain a copy of the License at 10*353d8f4dSAndrew Rist * 11*353d8f4dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*353d8f4dSAndrew Rist * 13*353d8f4dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*353d8f4dSAndrew Rist * software distributed under the License is distributed on an 15*353d8f4dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*353d8f4dSAndrew Rist * KIND, either express or implied. See the License for the 17*353d8f4dSAndrew Rist * specific language governing permissions and limitations 18*353d8f4dSAndrew Rist * under the License. 19*353d8f4dSAndrew Rist * 20*353d8f4dSAndrew Rist *************************************************************/ 21*353d8f4dSAndrew Rist 22*353d8f4dSAndrew Rist 23cdf0e10cSrcweir #ifndef _SFX_SRCHDLG_HXX_ 24cdf0e10cSrcweir #define _SFX_SRCHDLG_HXX_ 25cdf0e10cSrcweir 26cdf0e10cSrcweir #ifndef _VCL_BUTTON_HXX 27cdf0e10cSrcweir #include <vcl/button.hxx> 28cdf0e10cSrcweir #endif 29cdf0e10cSrcweir #include <vcl/combobox.hxx> 30cdf0e10cSrcweir #ifndef _VCL_EDIT_HXX 31cdf0e10cSrcweir #include <vcl/edit.hxx> 32cdf0e10cSrcweir #endif 33cdf0e10cSrcweir #ifndef _VCL_FIXED_HXX 34cdf0e10cSrcweir #include <vcl/fixed.hxx> 35cdf0e10cSrcweir #endif 36cdf0e10cSrcweir #include <sfx2/basedlgs.hxx> 37cdf0e10cSrcweir 38cdf0e10cSrcweir // ============================================================================ 39cdf0e10cSrcweir 40cdf0e10cSrcweir namespace sfx2 { 41cdf0e10cSrcweir 42cdf0e10cSrcweir // ============================================================================ 43cdf0e10cSrcweir // SearchDialog 44cdf0e10cSrcweir // ============================================================================ 45cdf0e10cSrcweir 46cdf0e10cSrcweir class SearchDialog : public ModelessDialog 47cdf0e10cSrcweir { 48cdf0e10cSrcweir private: 49cdf0e10cSrcweir FixedText m_aSearchLabel; 50cdf0e10cSrcweir ComboBox m_aSearchEdit; 51cdf0e10cSrcweir CheckBox m_aWholeWordsBox; 52cdf0e10cSrcweir CheckBox m_aMatchCaseBox; 53cdf0e10cSrcweir CheckBox m_aWrapAroundBox; 54cdf0e10cSrcweir CheckBox m_aBackwardsBox; 55cdf0e10cSrcweir PushButton m_aFindBtn; 56cdf0e10cSrcweir CancelButton m_aCancelBtn; 57cdf0e10cSrcweir 58cdf0e10cSrcweir Link m_aFindHdl; 59cdf0e10cSrcweir Link m_aCloseHdl; 60cdf0e10cSrcweir 61cdf0e10cSrcweir String m_sToggleText; 62cdf0e10cSrcweir ::rtl::OUString m_sConfigName; 63cdf0e10cSrcweir ByteString m_sWinState; 64cdf0e10cSrcweir 65cdf0e10cSrcweir bool m_bIsConstructed; 66cdf0e10cSrcweir 67cdf0e10cSrcweir void LoadConfig(); 68cdf0e10cSrcweir void SaveConfig(); 69cdf0e10cSrcweir 70cdf0e10cSrcweir DECL_LINK( FindHdl, PushButton* ); 71cdf0e10cSrcweir DECL_LINK( ToggleHdl, CheckBox* ); 72cdf0e10cSrcweir 73cdf0e10cSrcweir public: 74cdf0e10cSrcweir SearchDialog( Window* pWindow, const ::rtl::OUString& rConfigName ); 75cdf0e10cSrcweir ~SearchDialog(); 76cdf0e10cSrcweir SetFindHdl(const Link & rLink)77cdf0e10cSrcweir inline void SetFindHdl( const Link& rLink ) { m_aFindHdl = rLink; } SetCloseHdl(const Link & rLink)78cdf0e10cSrcweir inline void SetCloseHdl( const Link& rLink ) { m_aCloseHdl = rLink; } 79cdf0e10cSrcweir GetSearchText() const80cdf0e10cSrcweir inline String GetSearchText() const { return m_aSearchEdit.GetText(); } SetSearchText(const String & _rText)81cdf0e10cSrcweir inline void SetSearchText( const String& _rText ) { m_aSearchEdit.SetText( _rText ); } IsOnlyWholeWords() const82cdf0e10cSrcweir inline bool IsOnlyWholeWords() const { return ( m_aWholeWordsBox.IsChecked() != sal_False ); } IsMarchCase() const83cdf0e10cSrcweir inline bool IsMarchCase() const { return ( m_aMatchCaseBox.IsChecked() != sal_False ); } IsWrapAround() const84cdf0e10cSrcweir inline bool IsWrapAround() const { return ( m_aWrapAroundBox.IsChecked() != sal_False ); } IsSearchBackwards() const85cdf0e10cSrcweir inline bool IsSearchBackwards() const { return ( m_aBackwardsBox.IsChecked() != sal_False ); } 86cdf0e10cSrcweir 87cdf0e10cSrcweir void SetFocusOnEdit(); 88cdf0e10cSrcweir 89cdf0e10cSrcweir virtual sal_Bool Close(); 90cdf0e10cSrcweir virtual void Move(); 91cdf0e10cSrcweir virtual void StateChanged( StateChangedType nStateChange ); 92cdf0e10cSrcweir }; 93cdf0e10cSrcweir 94cdf0e10cSrcweir // ============================================================================ 95cdf0e10cSrcweir 96cdf0e10cSrcweir } // namespace sfx2 97cdf0e10cSrcweir 98cdf0e10cSrcweir // ============================================================================ 99cdf0e10cSrcweir 100cdf0e10cSrcweir #endif // _SFX_SRCHDLG_HXX_ 101cdf0e10cSrcweir 102