Line data Source code
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 : #ifndef INCLUDED_DBACCESS_SOURCE_UI_APP_APPSWAPWINDOW_HXX
20 : #define INCLUDED_DBACCESS_SOURCE_UI_APP_APPSWAPWINDOW_HXX
21 :
22 : #include "IClipBoardTest.hxx"
23 : #include <vcl/lstbox.hxx>
24 : #include <vcl/vclptr.hxx>
25 : #include "AppIconControl.hxx"
26 : #include "AppElementType.hxx"
27 :
28 : namespace dbaui
29 : {
30 : class OAppBorderWindow;
31 : class OApplicationSwapWindow : public vcl::Window,
32 : public IClipboardTest
33 : {
34 : VclPtr<OApplicationIconControl> m_aIconControl;
35 : ElementType m_eLastType;
36 : OAppBorderWindow& m_rBorderWin;
37 :
38 : void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
39 :
40 : DECL_LINK( OnContainerSelectHdl, SvtIconChoiceCtrl* );
41 : DECL_LINK( ChangeToLastSelected, void* );
42 : protected:
43 : virtual void DataChanged(const DataChangedEvent& rDCEvt) SAL_OVERRIDE;
44 : public:
45 : OApplicationSwapWindow( vcl::Window* _pParent, OAppBorderWindow& _rBorderWindow );
46 : virtual ~OApplicationSwapWindow();
47 : // Window overrides
48 : virtual void dispose() SAL_OVERRIDE;
49 : virtual void Resize() SAL_OVERRIDE;
50 :
51 0 : bool isCutAllowed() SAL_OVERRIDE { return false; }
52 0 : bool isCopyAllowed() SAL_OVERRIDE { return false; }
53 0 : bool isPasteAllowed() SAL_OVERRIDE { return false; }
54 0 : virtual bool hasChildPathFocus() SAL_OVERRIDE { return HasChildPathFocus(); }
55 0 : void copy() SAL_OVERRIDE { }
56 0 : void cut() SAL_OVERRIDE { }
57 0 : void paste() SAL_OVERRIDE { }
58 :
59 22 : inline sal_uLong GetEntryCount() const { return m_aIconControl->GetEntryCount(); }
60 22 : inline SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return m_aIconControl->GetEntry(nPos); }
61 22 : inline Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const { return m_aIconControl->GetBoundingBox(pEntry); }
62 :
63 : /** automatically creates mnemonics for the icon/texts in our left hand side panel
64 : */
65 : void createIconAutoMnemonics( MnemonicGenerator& _rMnemonics );
66 :
67 : /** called to give the window the chance to intercept key events, while it has not
68 : the focus
69 :
70 : @return <TRUE/> if and only if the event has been handled, and should not
71 : not be further processed
72 : */
73 : bool interceptKeyInput( const KeyEvent& _rEvent );
74 :
75 : /// return the element of currently select entry
76 : ElementType getElementType() const;
77 :
78 : /** clears the selection in the icon choice control and calls the handler
79 : */
80 : void clearSelection();
81 :
82 : /** changes the container which should be displayed. The select handler will also be called.
83 : @param _eType
84 : Which container to show.
85 : */
86 : void selectContainer(ElementType _eType);
87 :
88 : private:
89 : bool onContainerSelected( ElementType _eType );
90 : };
91 : } // namespace dbaui
92 : #endif // INCLUDED_DBACCESS_SOURCE_UI_APP_APPSWAPWINDOW_HXX
93 :
94 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|