Branch data 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 : :
20 : : #ifndef SD_TAB_CONTROL_HXX
21 : : #define SD_TAB_CONTROL_HXX
22 : :
23 : : #include <svtools/tabbar.hxx>
24 : : #include <svtools/transfer.hxx>
25 : :
26 : : namespace sd {
27 : :
28 : : /*************************************************************************
29 : : |*
30 : : |* TabControl-Klasse fuer Seitenumschaltung
31 : : |*
32 : : \************************************************************************/
33 : :
34 : : class DrawViewShell;
35 : :
36 : : class TabControl
37 : : : public TabBar,
38 : : public DragSourceHelper,
39 : : public DropTargetHelper
40 : : {
41 : : public:
42 : : TabControl (DrawViewShell* pDrViewSh, ::Window* pParent);
43 : : virtual ~TabControl (void);
44 : :
45 : : /** Inform all listeners of this control that the current page has been
46 : : activated. Call this method after switching the current page and is
47 : : not done elsewhere (like when using page up/down keys).
48 : : */
49 : : void SendActivatePageEvent (void);
50 : :
51 : : /** Inform all listeners of this control that the current page has been
52 : : deactivated. Call this method before switching the current page and
53 : : is not done elsewhere (like when using page up/down keys).
54 : : */
55 : : void SendDeactivatePageEvent (void);
56 : :
57 : : protected:
58 : : DrawViewShell* pDrViewSh;
59 : : sal_Bool bInternalMove;
60 : :
61 : : // TabBar
62 : : virtual void Select();
63 : : virtual void DoubleClick();
64 : : virtual void MouseButtonDown(const MouseEvent& rMEvt);
65 : :
66 : : virtual void Command(const CommandEvent& rCEvt);
67 : :
68 : : virtual long StartRenaming();
69 : : virtual long AllowRenaming();
70 : : virtual void EndRenaming();
71 : :
72 : : virtual void ActivatePage();
73 : : virtual long DeactivatePage();
74 : :
75 : : // DragSourceHelper
76 : : virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
77 : :
78 : : // DropTargetHelper
79 : : virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
80 : : virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
81 : :
82 : : DECL_LINK(DeactivatePageHdl, void*);
83 : :
84 : : private:
85 : : // nested class to implement the TransferableHelper
86 : : class TabControlTransferable : public TransferableHelper
87 : : {
88 : : public:
89 : 0 : TabControlTransferable( TabControl& rParent ) :
90 : 0 : mrParent( rParent ) {}
91 : : private:
92 : :
93 : : TabControl& mrParent;
94 : :
95 : : virtual ~TabControlTransferable();
96 : :
97 : : virtual void AddSupportedFormats();
98 : : virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
99 : : virtual void DragFinished( sal_Int8 nDropAction );
100 : :
101 : : };
102 : :
103 : : friend class TabControl::TabControlTransferable;
104 : :
105 : : void DragFinished( sal_Int8 nDropAction );
106 : :
107 : : private:
108 : : using TabBar::StartDrag;
109 : : };
110 : :
111 : : } // end of namespace sd
112 : :
113 : : #endif
114 : :
115 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|