summaryrefslogtreecommitdiff
path: root/source/dpdimension.cxx
blob: 66db901d27e29af67deaea7fc36f33bd6f59c4e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132

#include "dpdimension.hxx"
#include "dphierarchies.hxx"

using ::com::sun::star::beans::XPropertyChangeListener;
using ::com::sun::star::beans::XVetoableChangeListener;
using ::com::sun::star::lang::IllegalArgumentException;
using ::com::sun::star::lang::WrappedTargetException;
using ::com::sun::star::beans::PropertyVetoException;
using ::com::sun::star::beans::UnknownPropertyException;
using ::com::sun::star::beans::XPropertySetInfo;
using ::com::sun::star::container::XNameAccess;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::Any;
using ::rtl::OUString;


#include <stdio.h>
#include <string>
#include <sys/time.h>

namespace {

class StackPrinter
{
public:
    explicit StackPrinter(const char* msg) :
        msMsg(msg)
    {
        fprintf(stdout, "%s: --begin\n", msMsg.c_str());
        mfStartTime = getTime();
    }

    ~StackPrinter()
    {
        double fEndTime = getTime();
        fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime));
    }

private:
    double getTime() const
    {
        timeval tv;
        gettimeofday(&tv, NULL);
        return tv.tv_sec + tv.tv_usec / 1000000.0;
    }

    ::std::string msMsg;
    double mfStartTime;
};

}

namespace dpsource {

DPDimension::DPDimension()
{
}

DPDimension::~DPDimension()
{
}

// XNamed

OUString DPDimension::getName() throw (RuntimeException)
{
    return maName;
}

void DPDimension::setName(const OUString& aName) throw (RuntimeException)
{
    maName = aName;
}

// XHierarchiesSupplier

Reference<XNameAccess> DPDimension::getHierarchies() throw (RuntimeException)
{
    if (!mxHierarchies.is())
        mxHierarchies.set(new DPHierarchies(this));
    return mxHierarchies;
}

// XPropertySet

Reference<XPropertySetInfo> DPDimension::getPropertySetInfo() throw (RuntimeException)
{
    return Reference<XPropertySetInfo>();
}

void DPDimension::setPropertyValue(const OUString& aPropertyName, const Any& aValue)
    throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
    StackPrinter __stack_printer__("dpsource/DPDimension::setPropertyValue");
    fprintf(stdout, "DPDimension::setPropertyValue:   prop name = '%s'\n", rtl::OUStringToOString(aPropertyName, RTL_TEXTENCODING_UTF8).getStr());
}

Any DPDimension::getPropertyValue(const OUString& aPropertyName)
    throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
    fprintf(stdout, "DPDimension::getPropertyValue:   prop name = '%s'\n", rtl::OUStringToOString(aPropertyName, RTL_TEXTENCODING_UTF8).getStr());
    return Any();
}

void DPDimension::addPropertyChangeListener(
    const OUString& aPropertyName, const Reference<XPropertyChangeListener>& xListener)
        throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}

void DPDimension::removePropertyChangeListener(
    const OUString& aPropertyName, const Reference<XPropertyChangeListener>& aListener) 
        throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}

void DPDimension::addVetoableChangeListener(
    const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener)
        throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}

void DPDimension::removeVetoableChangeListener(
    const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener)
    throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
}

}