LibreOffice Module svx (master) 1
srchctrl.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <svl/intitem.hxx>
21#include <sfx2/objsh.hxx>
22
23#include <svx/svxids.hrc>
24
25#include "srchctrl.hxx"
26#include <svx/srchdlg.hxx>
27#include <svl/srchitem.hxx>
28
30(
31 sal_uInt16 _nId,
32 SfxBindings& rBind,
33 SvxSearchDialog& rDlg
34) :
35 SfxControllerItem( _nId, rBind ),
36
37 rSrchDlg( rDlg )
38{
39}
40
41
43 const SfxPoolItem* pState )
44{
45 if ( SfxItemState::DEFAULT == eState )
46 {
47 if ( SID_STYLE_FAMILY1 <= nSID && nSID <= SID_STYLE_FAMILY4 )
48 {
50
51 if ( pShell && pShell->GetStyleSheetPool() )
53 }
54 else if ( SID_SEARCH_OPTIONS == nSID )
55 {
56 DBG_ASSERT( dynamic_cast<const SfxUInt16Item* >(pState) != nullptr, "wrong item type" );
57 SearchOptionFlags nFlags = static_cast<SearchOptionFlags>(static_cast<const SfxUInt16Item*>(pState)->GetValue());
59 }
60 else if ( SID_SEARCH_ITEM == nSID )
61 {
62 DBG_ASSERT( dynamic_cast<const SvxSearchItem*>( pState) != nullptr, "wrong item type" );
63 rSrchDlg.SetItem_Impl( static_cast<const SvxSearchItem*>(pState) );
64 }
65 }
66 else if ( SID_SEARCH_OPTIONS == nSID || SID_SEARCH_ITEM == nSID )
67 rSrchDlg.EnableControls_Impl( SearchOptionFlags::NONE );
68}
69
70
71/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SfxStyleSheetBasePool * GetStyleSheetPool()
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
virtual void StateChangedAtToolBoxControl(sal_uInt16, SfxItemState, const SfxPoolItem *pState) override
Definition: srchctrl.cxx:42
SvxSearchDialog & rSrchDlg
Definition: srchctrl.hxx:27
SvxSearchController(sal_uInt16 nId, SfxBindings &rBnd, SvxSearchDialog &rDlg)
Definition: srchctrl.cxx:30
In this modeless dialog the attributes for a search are configured and a search is started from it.
Definition: srchdlg.hxx:111
SVX_DLLPRIVATE void EnableControls_Impl(const SearchOptionFlags nFlags)
Definition: srchdlg.cxx:1649
SVX_DLLPRIVATE void TemplatesChanged_Impl(SfxStyleSheetBasePool &rPool)
Definition: srchdlg.cxx:1610
SVX_DLLPRIVATE void SetItem_Impl(const SvxSearchItem *pItem)
Definition: srchdlg.cxx:1871
#define DBG_ASSERT(sCon, aError)
const char GetValue[]
SfxItemState
SearchOptionFlags