bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / inc / TabControl.hxx
bloba6cc7d9c813bba5b010b8887aa739525bbfbe7dd
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 #ifndef SD_TAB_CONTROL_HXX
21 #define SD_TAB_CONTROL_HXX
23 #include <svtools/tabbar.hxx>
24 #include <svtools/transfer.hxx>
26 namespace sd {
28 /**
29 * TabControl-Class for page switch
32 class DrawViewShell;
34 class TabControl
35 : public TabBar,
36 public DragSourceHelper,
37 public DropTargetHelper
39 public:
40 TabControl (DrawViewShell* pDrViewSh, ::Window* pParent);
41 virtual ~TabControl (void);
43 /** Inform all listeners of this control that the current page has been
44 activated. Call this method after switching the current page and is
45 not done elsewhere (like when using page up/down keys).
47 void SendActivatePageEvent (void);
49 /** Inform all listeners of this control that the current page has been
50 deactivated. Call this method before switching the current page and
51 is not done elsewhere (like when using page up/down keys).
53 void SendDeactivatePageEvent (void);
55 protected:
56 DrawViewShell* pDrViewSh;
57 sal_Bool bInternalMove;
59 // TabBar
60 virtual void Select();
61 virtual void DoubleClick();
62 virtual void MouseButtonDown(const MouseEvent& rMEvt);
64 virtual void Command(const CommandEvent& rCEvt);
66 virtual long StartRenaming();
67 virtual long AllowRenaming();
68 virtual void EndRenaming();
70 virtual void ActivatePage();
71 virtual long DeactivatePage();
73 // DragSourceHelper
74 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
76 // DropTargetHelper
77 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
78 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
80 DECL_LINK(DeactivatePageHdl, void*);
82 private:
83 // nested class to implement the TransferableHelper
84 class TabControlTransferable : public TransferableHelper
86 public:
87 TabControlTransferable( TabControl& rParent ) :
88 mrParent( rParent ) {}
89 private:
91 TabControl& mrParent;
93 virtual ~TabControlTransferable();
95 virtual void AddSupportedFormats();
96 virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor );
97 virtual void DragFinished( sal_Int8 nDropAction );
101 friend class TabControl::TabControlTransferable;
103 void DragFinished( sal_Int8 nDropAction );
105 private:
106 using TabBar::StartDrag;
109 } // end of namespace sd
111 #endif
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */