summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/fax/CallWizard.py
blob: 21414507e6c6f4f79690d486ae3497864c7b3926 (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import traceback

class CallWizard(object):

    '''
    Gives a factory for creating the service. This method is called by the
    <code>JavaLoader</code>
    <p></p>
    @param stringImplementationName The implementation name of the component.
    @param xMSF The service manager, who gives access to every known service.
    @param xregistrykey Makes structural information (except regarding tree
    structures) of a single registry key accessible.
    @return Returns a <code>XSingleServiceFactory</code>
    for creating the component.
    @see com.sun.star.comp.loader.JavaLoader#
    '''

    @classmethod
    def __getServiceFactory(self, stringImplementationName, xMSF, \
        xregistrykey):

        xsingleservicefactory = None
        if stringImplementationName.equals(WizardImplementation.Name):
            xsingleservicefactory = FactoryHelper.getServiceFactory( \
                WizardImplementation, WizardImplementation.__serviceName,
                xMSF, xregistrykey)

        return xsingleservicefactory

    '''
    This class implements the component. At least the interfaces XServiceInfo,
    XTypeProvider, and XInitialization should be provided by the service.
    '''

    class WizardImplementation:
        __serviceName = "com.sun.star.wizards.fax.CallWizard"
        #private XMultiServiceFactory xmultiservicefactory

        '''
        The constructor of the inner class has a XMultiServiceFactory
        parameter.
        @param xmultiservicefactoryInitialization A special service factory
        could be introduced while initializing.
        '''

        @classmethod
        def WizardImplementation_XMultiServiceFactory(self, \
            xmultiservicefactoryInitialization):

            tmp = WizardImplementation()
            tmp.WizardImplementation_body_XMultiServiceFactory( \
                xmultiservicefactoryInitialization)
            return tmp

        def WizardImplementation_body_XMultiServiceFactory(self, \
            xmultiservicefactoryInitialization):

            self.xmultiservicefactory = xmultiservicefactoryInitialization
            if self.xmultiservicefactory != None:
                pass

        '''
        Execute Wizard
        @param str only valid parameter is 'start' at the moment.
        '''

        def trigger(self, str):
            if str.equalsIgnoreCase("start"):
                lw = FaxWizardDialogImpl(self.xmultiservicefactory)
                if not FaxWizardDialogImpl.running:
                    lw.startWizard(self.xmultiservicefactory, None)

        '''
        The service name, that must be used to get an instance of this service
        The service manager, that gives access to all registered services.
        This method is a member of the interface for initializing an object
        directly after its creation.
        @param object This array of arbitrary objects will be passed to the
        component after its creation.
        @throws com.sun.star.uno.Exception Every exception will not be
        handled, but will be passed to the caller.
        '''

        def initialize(self, object):
            pass

        '''
        This method returns an array of all supported service names.
        @return Array of supported service names.
        '''

        def getSupportedServiceNames(self):
            stringSupportedServiceNames = range(1)
            stringSupportedServiceNames[0] = self.__class__.__serviceName
            return (stringSupportedServiceNames)

        '''
        This method returns true, if the given service will be supported by
        the component.
        @param stringService Service name.
        @return True, if the given service name will be supported.
        '''

        def supportsService(self, stringService):
            booleanSupportsService = False
            if stringService.equals(self.__class__.__serviceName):
                booleanSupportsService = True

            return (booleanSupportsService)

        '''
        This method returns an array of bytes, that can be used to
        unambiguously distinguish between two sets of types,
        e.g. to realise hashing functionality when the object is introspected.
        Two objects that return the same ID also have to return the same
        set of types in getTypes(). If an unique implementation Id cannot be
        provided this method has to return an empty sequence. Important:
        If the object aggregates other objects the ID has to be unique for
        the whole combination of objects.
        @return Array of bytes, in order to distinguish between two sets.
        '''

        def getImplementationId(self):
            byteReturn = []
            try:
                byteReturn = ("" + self.hashCode()).Bytes
            except Exception, exception:
                traceback.print_exc()

            return (byteReturn)

        '''
        Return the class name of the component.
        @return Class name of the component.
        '''

        def getImplementationName(self):
            return (WizardImplementation.Name)

        '''
        Provides a sequence of all types (usually interface types) provided
        by the object.
        @return Sequence of all types (usually interface types) provided
        by the service.
        '''

        def getTypes(self):
            typeReturn = []
            try:
                #COMMENTED
                #typeReturn = [new Type (XPropertyAccess.class), new Type (XJob.class), new Type (XJobExecutor.class), new Type (XTypeProvider.class), new Type (XServiceInfo.class), new Type (XInitialization.class)]
            except Exception, exception:
                traceback.print_exc()

            return (typeReturn)