fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / svx / source / items / rotmodit.cxx
blobdcf0a2d03862679966193ed4ca6bcd7f93ee6f68
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <tools/stream.hxx>
21 #include <com/sun/star/table/BorderLine.hpp>
22 #include <com/sun/star/table/CellVertJustify2.hpp>
23 #include <com/sun/star/table/ShadowLocation.hpp>
24 #include <com/sun/star/table/TableBorder.hpp>
25 #include <com/sun/star/table/ShadowFormat.hpp>
26 #include <com/sun/star/table/CellRangeAddress.hpp>
27 #include <com/sun/star/table/CellContentType.hpp>
28 #include <com/sun/star/table/TableOrientation.hpp>
29 #include <com/sun/star/util/SortField.hpp>
30 #include <com/sun/star/util/SortFieldType.hpp>
31 #include <com/sun/star/table/CellOrientation.hpp>
32 #include <com/sun/star/table/CellAddress.hpp>
34 #include "svx/rotmodit.hxx"
36 using namespace ::rtl;
37 using namespace ::com::sun::star;
39 // STATIC DATA -----------------------------------------------------------
41 TYPEINIT1_FACTORY(SvxRotateModeItem, SfxEnumItem, new SvxRotateModeItem(SVX_ROTATE_MODE_STANDARD, 0));
44 //-----------------------------------------------------------------------
45 // SvxRotateModeItem - Ausrichtung bei gedrehtem Text
46 //-----------------------------------------------------------------------
48 SvxRotateModeItem::SvxRotateModeItem( SvxRotateMode eMode, sal_uInt16 _nWhich )
49 : SfxEnumItem( _nWhich, (sal_uInt16)eMode )
53 SvxRotateModeItem::SvxRotateModeItem( const SvxRotateModeItem& rItem )
54 : SfxEnumItem( rItem )
58 SvxRotateModeItem::~SvxRotateModeItem()
62 SfxPoolItem* SvxRotateModeItem::Create( SvStream& rStream, sal_uInt16 ) const
64 sal_uInt16 nVal;
65 rStream >> nVal;
66 return new SvxRotateModeItem( (SvxRotateMode) nVal,Which() );
69 SfxItemPresentation SvxRotateModeItem::GetPresentation(
70 SfxItemPresentation ePres,
71 SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
72 OUString& rText, const IntlWrapper * ) const
74 rText = OUString();
76 switch ( ePres )
78 case SFX_ITEM_PRESENTATION_COMPLETE:
79 rText += "...: ";
80 // break; // DURCHFALLEN!!!
82 case SFX_ITEM_PRESENTATION_NAMELESS:
83 rText += OUString::valueOf( GetValue() );
84 break;
85 default: ;//prevent warning
88 return ePres;
91 String SvxRotateModeItem::GetValueText( sal_uInt16 nVal ) const
93 String aText;
95 switch ( nVal )
97 case SVX_ROTATE_MODE_STANDARD:
98 case SVX_ROTATE_MODE_TOP:
99 case SVX_ROTATE_MODE_CENTER:
100 case SVX_ROTATE_MODE_BOTTOM:
101 aText.AppendAscii("...");
102 break;
103 default:
104 OSL_FAIL("SvxRotateModeItem: falscher enum");
105 break;
107 return aText;
110 sal_uInt16 SvxRotateModeItem::GetValueCount() const
112 return 4; // STANDARD, TOP, CENTER, BOTTOM
115 SfxPoolItem* SvxRotateModeItem::Clone( SfxItemPool* ) const
117 return new SvxRotateModeItem( *this );
120 sal_uInt16 SvxRotateModeItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
122 return 0;
125 bool SvxRotateModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
127 sal_Int32 nUno = table::CellVertJustify2::STANDARD;
128 switch ( (SvxRotateMode)GetValue() )
130 case SVX_ROTATE_MODE_STANDARD: nUno = table::CellVertJustify2::STANDARD; break;
131 case SVX_ROTATE_MODE_TOP: nUno = table::CellVertJustify2::TOP; break;
132 case SVX_ROTATE_MODE_CENTER: nUno = table::CellVertJustify2::CENTER; break;
133 case SVX_ROTATE_MODE_BOTTOM: nUno = table::CellVertJustify2::BOTTOM; break;
135 rVal <<= nUno;
136 return true;
139 bool SvxRotateModeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
141 sal_Int32 nUno(0);
142 if(!(rVal >>= nUno))
144 nUno = table::CellVertJustify2::STANDARD;
147 SvxRotateMode eSvx = SVX_ROTATE_MODE_STANDARD;
148 switch (nUno)
150 case table::CellVertJustify2::STANDARD: eSvx = SVX_ROTATE_MODE_STANDARD; break;
151 case table::CellVertJustify2::TOP: eSvx = SVX_ROTATE_MODE_TOP; break;
152 case table::CellVertJustify2::CENTER: eSvx = SVX_ROTATE_MODE_CENTER; break;
153 case table::CellVertJustify2::BOTTOM: eSvx = SVX_ROTATE_MODE_BOTTOM; break;
154 default: ;//prevent warning
156 SetValue( (sal_uInt16)eSvx );
157 return true;
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */