1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_SVX_CUBE3D_HXX
21 #define INCLUDED_SVX_CUBE3D_HXX
23 #include <svx/obj3d.hxx>
24 #include <svx/svxdllapi.h>
26 /*************************************************************************
29 |* Create a 3D cuboid; aPos: Center oder left, bottom, behind |__
30 |* (depending on bPosIsCenter) /
31 |* nSideFlags indicates, if only some of the cuboid surfaces can
32 |* be created; the corresponding bits are defined in the enum.
33 |* The flag bDblSided indicates whether the created surfaces are
34 |* two-sided (which only makes sense if not all of the surfaces were
37 \************************************************************************/
39 enum { CUBE_BOTTOM
= 0x0001, CUBE_BACK
= 0x0002, CUBE_LEFT
= 0x0004,
40 CUBE_TOP
= 0x0008, CUBE_RIGHT
= 0x0010, CUBE_FRONT
= 0x0020,
41 CUBE_FULL
= 0x003F, CUBE_OPEN_TB
= 0x0036, CUBE_OPEN_LR
= 0x002B,
42 CUBE_OPEN_FB
= 0x001D };
44 class SVX_DLLPUBLIC SAL_WARN_UNUSED E3dCubeObj
: public E3dCompoundObject
48 basegfx::B3DPoint aCubePos
;
49 basegfx::B3DVector aCubeSize
;
50 sal_uInt16 nSideFlags
;
53 bool bPosIsCenter
: 1;
56 void SetDefaultAttributes(E3dDefaultAttributes
& rDefault
);
57 virtual sdr::contact::ViewContact
* CreateObjectSpecificViewContact() SAL_OVERRIDE
;
61 E3dCubeObj(E3dDefaultAttributes
& rDefault
, basegfx::B3DPoint aPos
, const basegfx::B3DVector
& r3DSize
);
64 virtual sal_uInt16
GetObjIdentifier() const SAL_OVERRIDE
;
65 virtual SdrObject
* DoConvertToPolyObj(bool bBezier
, bool bAddText
) const SAL_OVERRIDE
;
67 virtual E3dCubeObj
* Clone() const SAL_OVERRIDE
;
69 // Set local parameters with geometry recreation
70 void SetCubePos(const basegfx::B3DPoint
& rNew
);
71 const basegfx::B3DPoint
& GetCubePos() const { return aCubePos
; }
73 void SetCubeSize(const basegfx::B3DVector
& rNew
);
74 const basegfx::B3DVector
& GetCubeSize() const { return aCubeSize
; }
76 void SetPosIsCenter(bool bNew
);
77 bool GetPosIsCenter() const { return bPosIsCenter
; }
79 sal_uInt16
GetSideFlags() { return nSideFlags
; }
81 // TakeObjName...() is for the display in the UI, for example "3 frames selected".
82 virtual OUString
TakeObjNameSingul() const SAL_OVERRIDE
;
83 virtual OUString
TakeObjNamePlural() const SAL_OVERRIDE
;
86 #endif // INCLUDED_SVX_CUBE3D_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */