Line data Source code
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 : #ifndef TABITEMDESCRIPTOR_HXX
21 : #define TABITEMDESCRIPTOR_HXX
22 :
23 : #include "svtools/toolpanel/toolpanel.hxx"
24 : #include "svtools/toolpanel/tabitemcontent.hxx"
25 :
26 : #include <tools/gen.hxx>
27 : #include <osl/diagnose.h>
28 :
29 : #include <vector>
30 :
31 : //........................................................................
32 : namespace svt
33 : {
34 : //........................................................................
35 :
36 : //==================================================================================================================
37 : //= ItemDescriptor
38 : //==================================================================================================================
39 0 : struct ItemDescriptor
40 : {
41 : PToolPanel pPanel;
42 : Rectangle aCompleteArea; // bounding area if the both text and icon are to be rendererd
43 : Rectangle aIconOnlyArea; // bounding area if the icon is to be rendererd
44 : Rectangle aTextOnlyArea; // bounding area if the text is to be rendererd
45 : TabItemContent eContent;
46 : // content to be used for this particular item. Might differ from item content which has been set
47 : // up for the complete control, in case not the complete content fits into the available space.
48 :
49 0 : ItemDescriptor()
50 : :pPanel()
51 : ,aCompleteArea()
52 : ,aIconOnlyArea()
53 : ,aTextOnlyArea()
54 0 : ,eContent( TABITEM_IMAGE_AND_TEXT )
55 : {
56 0 : }
57 :
58 0 : const Rectangle& GetRect( const TabItemContent i_eItemContent ) const
59 : {
60 : OSL_ENSURE( i_eItemContent != TABITEM_AUTO, "ItemDescriptor::GetRect: illegal value!" );
61 :
62 : return ( i_eItemContent == TABITEM_IMAGE_AND_TEXT )
63 : ? aCompleteArea
64 : : ( ( i_eItemContent == TABITEM_TEXT_ONLY )
65 : ? aTextOnlyArea
66 : : aIconOnlyArea
67 0 : );
68 : }
69 :
70 0 : const Rectangle& GetCurrentRect() const
71 : {
72 0 : return GetRect( eContent );
73 : }
74 : };
75 :
76 : typedef ::std::vector< ItemDescriptor > ItemDescriptors;
77 :
78 :
79 : //........................................................................
80 : } // namespace svt
81 : //........................................................................
82 :
83 : #endif // TABITEMDESCRIPTOR_HXX
84 :
85 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|