fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / hdrcont.hxx
blob2fd02e59a1163f1b652fada27ed72f1200e06fe7
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 INCLUDED_SC_SOURCE_UI_INC_HDRCONT_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_HDRCONT_HXX
23 #include <vcl/window.hxx>
24 #include <vcl/seleng.hxx>
25 #include "address.hxx"
27 #define HDR_SIZE_OPTIMUM 0xFFFF
29 // Size of the sliders
30 #define HDR_SLIDERSIZE 2
32 class ScHeaderControl : public vcl::Window
34 private:
35 SelectionEngine* pSelEngine;
36 vcl::Font aNormFont;
37 vcl::Font aBoldFont;
38 bool bBoldSet;
40 bool bVertical; // Vertical = Row header
42 long nWidth;
43 long nSmallWidth;
44 long nBigWidth;
46 SCCOLROW nSize;
48 SCCOLROW nMarkStart;
49 SCCOLROW nMarkEnd;
50 bool bMarkRange;
52 bool bDragging; // Resizing
53 SCCOLROW nDragNo;
54 long nDragStart;
55 long nDragPos;
56 bool bDragMoved;
58 bool bIgnoreMove;
60 long GetScrPos( SCCOLROW nEntryNo ) const;
61 SCCOLROW GetMousePos( const MouseEvent& rMEvt, bool& rBorder ) const;
62 bool IsSelectionAllowed(SCCOLROW nPos) const;
63 void ShowDragHelp();
65 void DoPaint( SCCOLROW nStart, SCCOLROW nEnd );
67 void DrawShadedRect( long nStart, long nEnd, const Color& rBaseColor );
69 protected:
70 // Window overrides
72 virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE;
74 virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
75 virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
76 virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
77 virtual void Tracking( const TrackingEvent& rTEvt ) SAL_OVERRIDE;
79 virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
81 // new methods
83 virtual SCCOLROW GetPos() const = 0; // current position (Scrolling)
84 virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ) const = 0; // width / height (Pixel)
85 virtual OUString GetEntryText( SCCOLROW nEntryNo ) const = 0;
87 virtual SCCOLROW GetHiddenCount( SCCOLROW nEntryNo ) const;
88 virtual bool IsLayoutRTL() const;
89 virtual bool IsMirrored() const;
91 virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewWidth ) = 0;
92 virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd ) = 0;
94 virtual void SetMarking( bool bSet );
95 virtual void SelectWindow();
96 virtual bool IsDisabled() const;
97 virtual bool ResizeAllowed() const;
98 virtual OUString GetDragHelp( long nVal );
100 virtual void DrawInvert( long nDragPos );
101 virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
103 public:
104 ScHeaderControl( vcl::Window* pParent, SelectionEngine* pSelectionEngine,
105 SCCOLROW nNewSize, bool bNewVertical );
106 virtual ~ScHeaderControl();
108 void SetIgnoreMove(bool bSet) { bIgnoreMove = bSet; }
110 void StopMarking();
112 void SetMark( bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd );
114 long GetWidth() const { return nWidth; }
115 long GetSmallWidth() const { return nSmallWidth; }
116 long GetBigWidth() const { return nBigWidth; }
117 void SetWidth( long nNew );
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */