update dev300-m57
[ooovba.git] / sc / source / ui / inc / tabcont.hxx
blob70387701c1839e71434c678210ed16ca691d6cbf
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tabcont.hxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_TABCONT_HXX
32 #define SC_TABCONT_HXX
34 #include "address.hxx"
35 #include <svtools/tabbar.hxx>
36 #include <svtools/transfer.hxx>
39 class ScViewData;
41 // ---------------------------------------------------------------------------
43 // initial size
44 #define SC_TABBAR_DEFWIDTH 270
47 class ScTabControl : public TabBar, public DropTargetHelper, public DragSourceHelper
49 private:
50 ScViewData* pViewData;
51 USHORT nMouseClickPageId; /// Last page ID after mouse button down/up
52 USHORT nSelPageIdByMouse; /// Selected page ID, if selected with mouse
53 BOOL bErrorShown;
55 void DoDrag( const Region& rRegion );
57 USHORT GetMaxId() const;
58 SCTAB GetPrivatDropPos(const Point& rPos );
60 protected:
61 virtual void Select();
62 virtual void Command( const CommandEvent& rCEvt );
63 virtual void MouseButtonDown( const MouseEvent& rMEvt );
64 virtual void MouseButtonUp( const MouseEvent& rMEvt );
66 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
67 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
69 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
71 virtual long StartRenaming();
72 virtual long AllowRenaming();
73 virtual void EndRenaming();
74 virtual void Mirror();
76 public:
77 ScTabControl( Window* pParent, ScViewData* pData );
78 ~ScTabControl();
80 using TabBar::StartDrag;
82 void UpdateStatus();
83 void ActivateView(BOOL bActivate);
85 void SetSheetLayoutRTL( BOOL bSheetRTL );
90 #endif