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 : #include "FixedText.hxx"
21 : #include "services.hxx"
22 : #include "property.hrc"
23 : #include "property.hxx"
24 : #include <tools/debug.hxx>
25 :
26 : //.........................................................................
27 : namespace frm
28 : {
29 : using namespace ::com::sun::star::uno;
30 : using namespace ::com::sun::star::sdb;
31 : using namespace ::com::sun::star::sdbc;
32 : using namespace ::com::sun::star::sdbcx;
33 : using namespace ::com::sun::star::beans;
34 : using namespace ::com::sun::star::container;
35 : using namespace ::com::sun::star::form;
36 : using namespace ::com::sun::star::awt;
37 : using namespace ::com::sun::star::io;
38 : using namespace ::com::sun::star::lang;
39 : using namespace ::com::sun::star::util;
40 :
41 : //------------------------------------------------------------------------------
42 0 : InterfaceRef SAL_CALL OFixedTextModel_CreateInstance(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException)
43 : {
44 0 : return *(new OFixedTextModel(_rxFactory));
45 : }
46 :
47 : //------------------------------------------------------------------
48 : DBG_NAME( OFixedTextModel )
49 : //------------------------------------------------------------------
50 0 : OFixedTextModel::OFixedTextModel( const Reference<XMultiServiceFactory>& _rxFactory )
51 0 : :OControlModel(_rxFactory, VCL_CONTROLMODEL_FIXEDTEXT)
52 :
53 : {
54 : DBG_CTOR( OFixedTextModel, NULL );
55 0 : m_nClassId = FormComponentType::FIXEDTEXT;
56 0 : }
57 :
58 : //------------------------------------------------------------------
59 0 : OFixedTextModel::OFixedTextModel( const OFixedTextModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
60 0 : :OControlModel( _pOriginal, _rxFactory )
61 :
62 : {
63 : DBG_CTOR( OFixedTextModel, NULL );
64 0 : }
65 :
66 : //------------------------------------------------------------------
67 0 : OFixedTextModel::~OFixedTextModel( )
68 : {
69 : DBG_DTOR( OFixedTextModel, NULL );
70 0 : }
71 :
72 : //------------------------------------------------------------------------------
73 0 : IMPLEMENT_DEFAULT_CLONING( OFixedTextModel )
74 :
75 : //------------------------------------------------------------------------------
76 0 : StringSequence SAL_CALL OFixedTextModel::getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException)
77 : {
78 0 : StringSequence aSupported = OControlModel::getSupportedServiceNames();
79 0 : aSupported.realloc(aSupported.getLength() + 1);
80 :
81 0 : ::rtl::OUString* pArray = aSupported.getArray();
82 0 : pArray[aSupported.getLength()-1] = FRM_SUN_COMPONENT_FIXEDTEXT;
83 0 : return aSupported;
84 : }
85 :
86 : //------------------------------------------------------------------------------
87 0 : void OFixedTextModel::describeAggregateProperties( Sequence< Property >& _rAggregateProps ) const
88 : {
89 0 : OControlModel::describeAggregateProperties( _rAggregateProps );
90 0 : RemoveProperty( _rAggregateProps, PROPERTY_TABSTOP );
91 0 : }
92 :
93 : //------------------------------------------------------------------------------
94 0 : ::rtl::OUString SAL_CALL OFixedTextModel::getServiceName() throw(RuntimeException)
95 : {
96 0 : return FRM_COMPONENT_FIXEDTEXT; // old (non-sun) name for compatibility !
97 : }
98 :
99 : //------------------------------------------------------------------------------
100 0 : void SAL_CALL OFixedTextModel::write(const Reference<XObjectOutputStream>& _rxOutStream)
101 : throw(IOException, RuntimeException)
102 : {
103 0 : OControlModel::write(_rxOutStream);
104 :
105 : // Version
106 0 : _rxOutStream->writeShort(0x0002);
107 0 : writeHelpTextCompatibly(_rxOutStream);
108 0 : }
109 :
110 : //------------------------------------------------------------------------------
111 0 : void SAL_CALL OFixedTextModel::read(const Reference<XObjectInputStream>& _rxInStream) throw(IOException, RuntimeException)
112 : {
113 0 : OControlModel::read(_rxInStream);
114 :
115 : // Version
116 0 : sal_Int16 nVersion = _rxInStream->readShort();
117 0 : if (nVersion > 1)
118 0 : readHelpTextCompatibly(_rxInStream);
119 0 : }
120 :
121 : //.........................................................................
122 : }
123 : //.........................................................................
124 :
125 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|