LibreOffice Module sw (master)  1
uitool.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 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_UITOOL_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_UITOOL_HXX
21 
22 #include <tools/wintypes.hxx>
23 #include <vcl/field.hxx>
24 #include <vcl/weld.hxx>
25 #include <swtypes.hxx>
26 #include <swdllapi.h>
27 
28 class MetricFormatter;
29 class SfxItemSet;
30 class SwPageDesc;
31 class SvxTabStopItem;
32 class SwWrtShell;
33 class ListBox;
34 namespace weld { class ComboBox; }
35 class SwDocShell;
36 class SwFrameFormat;
37 class SwTabCols;
38 class DateTime;
39 class SfxViewFrame;
40 class SwEditShell;
41 
42 // switch a metric
44 
45 // fill BoxInfo attribute
46 SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
47 
54 
62 SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet);
63 
64 
73 SW_DLLPUBLIC void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell);
74 
75 // SfxItemSets <-> PageDesc
76 void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
77 void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet);
78 
79 // fill tabs with default tabs
80 SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs);
81 
82 // erase DefaultTabs from TabStopArray
83 //void EraseDefTabs(SvxTabStopItem& rTabs);
84 
85 // determine space between 1st and 2nd element
87 
88 // determine whether a Sfx-PageDesc combination exists in the set
89 // and set this in the set and delete the transport items
90 // (PageBreak & PageModel) from the set
91 void SwToSfxPageDescAttr( SfxItemSet& rSet );
92 void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet );
93 
95 void SetDfltMetric(FieldUnit eMetric, bool bWeb);
96 
97 SW_DLLPUBLIC bool HasCharUnit( bool bWeb );
98 void SetApplyCharUnit(bool bApplyChar, bool bWeb);
99 
100 // fill ListBox with all char style templates, except the standard ones
101 SW_DLLPUBLIC void FillCharStyleListBox(weld::ComboBox& rToFill, SwDocShell* pDocSh, bool bSorted = false, bool bWithDefault = false);
102 
103 //inserts a string sorted into a ListBox,
104 SW_DLLPUBLIC void InsertStringSorted(const OUString& rId, const OUString& rEntry, weld::ComboBox& rToFill, int nOffset);
105 
106 // Get table width and alignment
107 SwTwips GetTableWidth( SwFrameFormat const * pFormat, SwTabCols const & rCols, sal_uInt16 *pPercent,
108  SwWrtShell* pSh );
109 
110 OUString GetAppLangDateTimeString( const DateTime& );
111 
112 // search for a command string within the menu structure and execute it
113 // at the dispatcher if there is one, if executed return true
114 bool ExecuteMenuCommand( PopupMenu const & rMenu, SfxViewFrame const & rViewFrame, sal_uInt16 nId );
115 
116 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_UITOOL_HXX
117 
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FieldUnit
SW_DLLPUBLIC bool HasCharUnit(bool bWeb)
Definition: uitool.cxx:810
void ItemSetToPageDesc(const SfxItemSet &rSet, SwPageDesc &rPageDesc)
Definition: uitool.cxx:267
void SwToSfxPageDescAttr(SfxItemSet &rSet)
Definition: uitool.cxx:652
SW_DLLPUBLIC void ApplyCharBackground(const Color &rBackgroundColor, SwWrtShell &rShell)
Apply character background on the shell.
Definition: uitool.cxx:184
SwTwips GetTableWidth(SwFrameFormat const *pFormat, SwTabCols const &rCols, sal_uInt16 *pPercent, SwWrtShell *pSh)
Definition: uitool.cxx:759
SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet &rSet)
Convert character specific attributes to general ones used by tab pages.
Definition: uitool.cxx:128
SW_DLLPUBLIC void FillCharStyleListBox(weld::ComboBox &rToFill, SwDocShell *pDocSh, bool bSorted=false, bool bWithDefault=false)
Definition: uitool.cxx:716
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:586
long SwTwips
Definition: swtypes.hxx:49
void SfxToSwPageDescAttr(const SwWrtShell &rShell, SfxItemSet &rSet)
Definition: uitool.cxx:592
OUString GetAppLangDateTimeString(const DateTime &)
Definition: uitool.cxx:800
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
Style of a layout element.
Definition: frmfmt.hxx:57
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:691
SW_DLLPUBLIC void InsertStringSorted(const OUString &rId, const OUString &rEntry, weld::ComboBox &rToFill, int nOffset)
Definition: uitool.cxx:703
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:815
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
SW_DLLPUBLIC void SetMetric(MetricFormatter &rCtrl, FieldUnit eUnit)
Definition: uitool.cxx:90
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem &rTabs)
Definition: uitool.cxx:574
void PageDescToItemSet(const SwPageDesc &rPageDesc, SfxItemSet &rSet)
Definition: uitool.cxx:410
bool ExecuteMenuCommand(PopupMenu const &rMenu, SfxViewFrame const &rViewFrame, sal_uInt16 nId)
Definition: uitool.cxx:820
SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet &rSet, const SwWrtShell &rSh)
Definition: uitool.cxx:103
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:698
SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet &rSet, const SfxItemSet &rOrigSet)
Convert general attributes to the corresponding character attributes.
Definition: uitool.cxx:156