LibreOffice Module svtools (master) 1
datwin.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <svtools/brwbox.hxx>
23#include <tools/long.hxx>
24#include <utility>
25
26#include <limits>
27
28#define MIN_COLUMNWIDTH 2
29
31{
34 OUString aText;
36
37public:
38 ButtonFrame( const Point& rPt, const Size& rSz,
39 OUString _aText,
40 bool _bDrawDisabled)
41 :aRect( rPt, rSz )
42 ,aInnerRect( Point( aRect.Left()+1, aRect.Top()+1 ),
43 Size( aRect.GetWidth()-2, aRect.GetHeight()-2 ) )
44 ,aText(std::move(_aText))
45 ,m_bDrawDisabled(_bDrawDisabled)
46 {
47 }
48
49 void Draw( OutputDevice& rDev );
50};
51
52
53class BrowserColumn final
54{
55 sal_uInt16 _nId;
58 OUString _aTitle;
60
61public:
62 BrowserColumn( sal_uInt16 nItemId,
63 OUString aTitle, sal_uLong nWidthPixel, const Fraction& rCurrentZoom );
65
66 sal_uInt16 GetId() const { return _nId; }
67
68 sal_uLong Width() const { return _nWidth; }
69 OUString& Title() { return _aTitle; }
70
71 bool IsFrozen() const { return _bFrozen; }
72 void Freeze() { _bFrozen = true; }
73
74 void Draw( BrowseBox const & rBox, OutputDevice& rDev,
75 const Point& rPos );
76
77 void SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZoom);
78 void ZoomChanged(const Fraction& rNewZoom);
79};
80
81void InitSettings_Impl( vcl::Window *pWin );
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 _nId
Definition: datwin.hxx:55
void SetWidth(sal_uLong nNewWidthPixel, const Fraction &rCurrentZoom)
Definition: datwin.cxx:109
sal_uLong _nWidth
Definition: datwin.hxx:57
OUString & Title()
Definition: datwin.hxx:69
BrowserColumn(sal_uInt16 nItemId, OUString aTitle, sal_uLong nWidthPixel, const Fraction &rCurrentZoom)
Definition: datwin.cxx:90
bool IsFrozen() const
Definition: datwin.hxx:71
OUString _aTitle
Definition: datwin.hxx:58
sal_uInt16 GetId() const
Definition: datwin.hxx:66
sal_uLong Width() const
Definition: datwin.hxx:68
bool _bFrozen
Definition: datwin.hxx:59
sal_uLong _nOriginalWidth
Definition: datwin.hxx:56
void ZoomChanged(const Fraction &rNewZoom)
Definition: datwin.cxx:168
void Draw(BrowseBox const &rBox, OutputDevice &rDev, const Point &rPos)
Definition: datwin.cxx:129
void Freeze()
Definition: datwin.hxx:72
ButtonFrame(const Point &rPt, const Size &rSz, OUString _aText, bool _bDrawDisabled)
Definition: datwin.hxx:38
tools::Rectangle aInnerRect
Definition: datwin.hxx:33
OUString aText
Definition: datwin.hxx:34
void Draw(OutputDevice &rDev)
Definition: datwin.cxx:32
tools::Rectangle aRect
Definition: datwin.hxx:32
bool m_bDrawDisabled
Definition: datwin.hxx:35
void InitSettings_Impl(vcl::Window *pWin)
Definition: datwin.cxx:233
sal_uIntPtr sal_uLong
Left