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 <vcl/field.hxx>
23 #include <vcl/weld.hxx>
24 #include <swtypes.hxx>
25 #include <swdllapi.h>
26 
27 class MetricFormatter;
28 class SfxItemSet;
29 class SwPageDesc;
30 class SvxTabStopItem;
31 class SwWrtShell;
32 class ListBox;
33 namespace weld { class ComboBox; }
34 class SwDocShell;
35 class SwFrameFormat;
36 class SwTabCols;
37 class DateTime;
38 class SfxViewFrame;
39 class SwEditShell;
40 
41 // switch a metric
43 
44 // fill BoxInfo attribute
45 SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
46 
53 
61 SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet);
62 
63 
72 SW_DLLPUBLIC void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell);
73 
74 // SfxItemSets <-> PageDesc
75 void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
76 void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet);
77 
78 // fill tabs with default tabs
79 SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs);
80 
81 // erase DefaultTabs from TabStopArray
82 //void EraseDefTabs(SvxTabStopItem& rTabs);
83 
84 // determine space between 1st and 2nd element
86 
87 // determine whether a Sfx-PageDesc combination exists in the set
88 // and set this in the set and delete the transport items
89 // (PageBreak & PageModel) from the set
90 void SwToSfxPageDescAttr( SfxItemSet& rSet );
91 void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet );
92 
94 void SetDfltMetric(FieldUnit eMetric, bool bWeb);
95 
96 SW_DLLPUBLIC bool HasCharUnit( bool bWeb );
97 void SetApplyCharUnit(bool bApplyChar, bool bWeb);
98 
99 // fill ListBox with all char style templates, except the standard ones
100 SW_DLLPUBLIC void FillCharStyleListBox(weld::ComboBox& rToFill, SwDocShell* pDocSh, bool bSorted = false, bool bWithDefault = false);
101 
102 //inserts a string sorted into a ListBox,
103 SW_DLLPUBLIC void InsertStringSorted(const OUString& rId, const OUString& rEntry, weld::ComboBox& rToFill, int nOffset);
104 
105 // Get table width and alignment
106 SwTwips GetTableWidth( SwFrameFormat const * pFormat, SwTabCols const & rCols, sal_uInt16 *pPercent,
107  SwWrtShell* pSh );
108 
109 OUString GetAppLangDateTimeString( const DateTime& );
110 
111 // search for a command string within the menu structure and execute it
112 // at the dispatcher if there is one, if executed return true
113 bool ExecuteMenuCommand( PopupMenu const & rMenu, SfxViewFrame const & rViewFrame, sal_uInt16 nId );
114 
115 #endif // INCLUDED_SW_SOURCE_UIBASE_INC_UITOOL_HXX
116 
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FieldUnit
SW_DLLPUBLIC bool HasCharUnit(bool bWeb)
Definition: uitool.cxx:829
void ItemSetToPageDesc(const SfxItemSet &rSet, SwPageDesc &rPageDesc)
Definition: uitool.cxx:286
void SwToSfxPageDescAttr(SfxItemSet &rSet)
Definition: uitool.cxx:671
SW_DLLPUBLIC void ApplyCharBackground(const Color &rBackgroundColor, SwWrtShell &rShell)
Apply character background on the shell.
Definition: uitool.cxx:203
SwTwips GetTableWidth(SwFrameFormat const *pFormat, SwTabCols const &rCols, sal_uInt16 *pPercent, SwWrtShell *pSh)
Definition: uitool.cxx:778
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:735
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:605
long SwTwips
Definition: swtypes.hxx:49
void SfxToSwPageDescAttr(const SwWrtShell &rShell, SfxItemSet &rSet)
Definition: uitool.cxx:611
OUString GetAppLangDateTimeString(const DateTime &)
Definition: uitool.cxx:819
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:710
SW_DLLPUBLIC void InsertStringSorted(const OUString &rId, const OUString &rEntry, weld::ComboBox &rToFill, int nOffset)
Definition: uitool.cxx:722
void SetApplyCharUnit(bool bApplyChar, bool bWeb)
Definition: uitool.cxx:834
#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:593
void PageDescToItemSet(const SwPageDesc &rPageDesc, SfxItemSet &rSet)
Definition: uitool.cxx:429
bool ExecuteMenuCommand(PopupMenu const &rMenu, SfxViewFrame const &rViewFrame, sal_uInt16 nId)
Definition: uitool.cxx:839
SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet &rSet, const SwWrtShell &rSh)
Definition: uitool.cxx:103
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:717
SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet &rSet, const SfxItemSet &rOrigSet)
Convert general attributes to the corresponding character attributes.
Definition: uitool.cxx:162