LibreOffice Module vcl (master)  1
controllayout.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 #if !defined(VCL_DLLIMPLEMENTATION) && !defined(TOOLKIT_DLLIMPLEMENTATION) && !defined(VCL_INTERNALS)
23 #error "don't use this in new code"
24 #endif
25 
26 #include <rtl/ustring.hxx>
27 #include <tools/gen.hxx>
28 #include <vector>
29 #include <vcl/ctrl.hxx>
30 #include <vcl/dllapi.h>
31 
32 namespace vcl
33 {
34 
36 {
37  // contains the string really displayed
38  // there must be exactly one bounding rectangle in m_aUnicodeBoundRects
39  // for every character in m_aDisplayText
40  OUString m_aDisplayText;
41  // the bounding rectangle of every character
42  // where one character may consist of many glyphs
43  std::vector< tools::Rectangle > m_aUnicodeBoundRects;
44  // start indices of lines
45  std::vector< tools::Long > m_aLineIndices;
46  // notify parent control on destruction
48 
51 
52  tools::Rectangle GetCharacterBounds( tools::Long nIndex ) const;
53  // returns the character index for corresponding to rPoint (in control coordinates)
54  // -1 is returned if no character is at that point
55  tools::Long GetIndexForPoint( const Point& rPoint ) const;
56  // returns the number of lines in the result of GetDisplayText()
57  tools::Long GetLineCount() const;
58  // returns the interval [start,end] of line nLine
59  // returns [-1,-1] for an invalid line
60  ::Pair GetLineStartEnd( tools::Long nLine ) const;
73  tools::Long ToRelativeLineIndex( tools::Long nIndex ) const;
74 };
75 
76 } // namespace vcl
77 
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< tools::Long > m_aLineIndices
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
long Long
std::vector< tools::Rectangle > m_aUnicodeBoundRects
VclPtr< const Control > m_pParent