update dev300-m58
[ooovba.git] / svx / source / dialog / srchctrl.cxx
blob515959fb034cd978c4eb580378a5c203647dd00a
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: srchctrl.cxx,v $
10 * $Revision: 1.8 $
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 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 // include ---------------------------------------------------------------
35 #include <tools/pstm.hxx>
36 #include <svtools/intitem.hxx>
37 #include <sfx2/objsh.hxx>
39 #include <svx/svxids.hrc>
41 #define _SVX_SRCHDLG_CXX // damit private-Methoden vom SrchDlg bekannt sind
45 #include "srchctrl.hxx"
46 #include "srchdlg.hxx"
47 #include <sfx2/srchitem.hxx>
49 // class SvxSearchFamilyControllerItem -----------------------------------
51 SvxSearchController::SvxSearchController
53 USHORT _nId,
54 SfxBindings& rBind,
55 SvxSearchDialog& rDlg
56 ) :
57 SfxControllerItem( _nId, rBind ),
59 rSrchDlg( rDlg )
63 // -----------------------------------------------------------------------
65 void SvxSearchController::StateChanged( USHORT nSID, SfxItemState eState,
66 const SfxPoolItem* pState )
68 if ( SFX_ITEM_AVAILABLE == eState )
70 if ( SID_STYLE_FAMILY1 <= nSID && nSID <= SID_STYLE_FAMILY4 )
72 SfxObjectShell* pShell = SfxObjectShell::Current();
74 if ( pShell && pShell->GetStyleSheetPool() )
75 rSrchDlg.TemplatesChanged_Impl( *pShell->GetStyleSheetPool() );
77 else if ( SID_SEARCH_OPTIONS == nSID )
79 DBG_ASSERT( pState->ISA(SfxUInt16Item), "wrong item type" );
80 USHORT nFlags = (USHORT)( (SfxUInt16Item*)pState )->GetValue();
81 rSrchDlg.EnableControls_Impl( nFlags );
83 else if ( SID_SEARCH_ITEM == nSID )
85 DBG_ASSERT( pState->ISA(SvxSearchItem), "wrong item type" );
86 rSrchDlg.SetItem_Impl( (const SvxSearchItem*)pState );
89 else if ( SID_SEARCH_OPTIONS == nSID || SID_SEARCH_ITEM == nSID )
90 rSrchDlg.EnableControls_Impl( 0 );