fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / svx / source / gallery2 / galbrws1.hxx
blob8c667c1f80261c4aeea986784d3f2efb48495c03
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <vcl/lstbox.hxx>
21 #include <vcl/button.hxx>
22 #include <vcl/menu.hxx>
23 #include <svl/lstner.hxx>
24 #include <vector>
25 #include "svx/galbrws.hxx"
27 #include <boost/function.hpp>
29 // -----------------
30 // - GalleryButton -
31 // -----------------
33 class GalleryButton : public PushButton
35 private:
37 virtual void KeyInput( const KeyEvent& rKEvt );
39 public:
41 GalleryButton( GalleryBrowser1* pParent, WinBits nWinBits );
42 ~GalleryButton();
45 // -----------------------
46 // - GalleryThemeListBox -
47 // -----------------------
49 class GalleryThemeListBox : public ListBox
51 protected:
53 void InitSettings();
55 virtual void DataChanged( const DataChangedEvent& rDCEvt );
56 virtual long PreNotify( NotifyEvent& rNEvt );
58 public:
60 GalleryThemeListBox( GalleryBrowser1* pParent, WinBits nWinBits );
61 ~GalleryThemeListBox();
64 // -------------------
65 // - GalleryBrowser1 -
66 // -------------------
68 class Gallery;
69 class GalleryThemeEntry;
70 class GalleryTheme;
71 class VclAbstractDialog2;
72 struct ExchangeData;
73 class SfxItemSet;
75 namespace svx { namespace sidebar { class GalleryControl; } }
77 class GalleryBrowser1 : public Control, SfxListener
79 friend class GalleryBrowser;
80 friend class svx::sidebar::GalleryControl;
81 friend class GalleryThemeListBox;
82 using Control::Notify;
83 using Window::KeyInput;
85 private:
87 GalleryButton maNewTheme;
88 GalleryThemeListBox* mpThemes;
89 Gallery* mpGallery;
90 ExchangeData* mpExchangeData;
91 SfxItemSet* mpThemePropsDlgItemSet;
93 Image aImgNormal;
94 Image aImgDefault;
95 Image aImgReadOnly;
96 Image aImgImported;
98 ::boost::function<sal_Bool(const KeyEvent&,Window*)> maKeyInputHandler;
99 ::boost::function<void(void)> maThemeSlectionHandler;
101 void ImplAdjustControls();
102 sal_uIntPtr ImplInsertThemeEntry( const GalleryThemeEntry* pEntry );
103 void ImplFillExchangeData( const GalleryTheme* pThm, ExchangeData& rData );
104 void ImplGetExecuteVector(::std::vector< sal_uInt16 >& o_aExec);
105 void ImplExecute( sal_uInt16 nId );
106 void ImplGalleryThemeProperties( const String & rThemeName, bool bCreateNew );
107 void ImplEndGalleryThemeProperties( VclAbstractDialog2* pDialog, bool bCreateNew );
109 // Control
110 virtual void Resize();
111 virtual void GetFocus();
113 // SfxListener
114 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
116 DECL_LINK( ClickNewThemeHdl, void* );
117 DECL_LINK( SelectThemeHdl, void* );
118 DECL_LINK( ShowContextMenuHdl, void* );
119 DECL_LINK( PopupMenuHdl, Menu* );
120 DECL_LINK( EndNewThemePropertiesDlgHdl, VclAbstractDialog2* );
121 DECL_LINK( EndThemePropertiesDlgHdl, VclAbstractDialog2* );
122 DECL_LINK( DestroyThemePropertiesDlgHdl, VclAbstractDialog2* );
124 public:
126 GalleryBrowser1(
127 Window* pParent,
128 const ResId& rResId,
129 Gallery* pGallery,
130 const ::boost::function<sal_Bool(const KeyEvent&,Window*)>& rKeyInputHandler,
131 const ::boost::function<void(void)>& rThemeSlectionHandler);
132 ~GalleryBrowser1();
134 void SelectTheme( const String& rThemeName ) { mpThemes->SelectEntry( rThemeName ); SelectThemeHdl( NULL ); }
135 void SelectTheme( sal_uIntPtr nThemePos ) { mpThemes->SelectEntryPos( (sal_uInt16) nThemePos ); SelectThemeHdl( NULL ); }
136 String GetSelectedTheme() { return mpThemes->GetEntryCount() ? mpThemes->GetEntry( mpThemes->GetSelectEntryPos() ) : String(); }
138 void ShowContextMenu();
139 sal_Bool KeyInput( const KeyEvent& rKEvt, Window* pWindow );
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */