xref: /AOO41X/main/offapi/com/sun/star/ucb/ContentAction.idl (revision d1766043198e81d0bcfc626e12893e7b4d7e31ca)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef __com_sun_star_ucb_ContentAction_idl__
24#define __com_sun_star_ucb_ContentAction_idl__
25
26
27//=============================================================================
28
29module com { module sun { module star { module ucb {
30
31//=============================================================================
32/** specifies actions which can be transported with content events.
33
34    <p>
35    The situations under which contents will send ContentEvents of the various
36    action types are described below.  The description is broken into a list of
37    useful definitions, a list of events that happen to contents, and a list of
38    reactions taken by contents in response to those events.
39    </p>
40
41    <p>
42    The definitions are as follows:
43    </p>
44
45    <table border =1>
46    <tr><td>D1</td><td>A content C has an identifier id(C).</td></tr>
47    <tr><td>D2</td><td>A content C is in one of two states, Alive or Deleted.
48                       </td></tr>
49    <tr><td>D3</td><td>A folder content F has a set of children H(F) that is a
50                       set of content identifiers. For example, an "open"
51                       command will usualy return a subset of the contents
52                       denoted by H(F).</td></tr>
53    </table>
54
55    <p>
56    The events that can happen to contents (and that are of interest in this
57    context) are listed next.  Note that 'event' here does not mean an
58    ContentEvent, but rather some event that occurs either because some content
59    processes a command, or because a content gets informed about a relevant
60    change in the underlying system it represents.
61    </p>
62
63    <table border =1>
64    <tr><td>E1</td><td>The identifier of a content C changes from id1(C) == A
65                       to id2(C) == B, denoted as E1(C: A->B). For example,
66                       this event may occur when content C processes a
67                       "setPropertyValues" command changing its "Title" propery,
68                       or when afolder that hierarchicaly contains C changes
69                       its identity.</td></tr>
70    <tr><td>E2</td><td>The state of a content C changes from Alive to Deleted,
71                       denoted as E2(C). For example, this event may occur when
72                       content C processes a "delete"   command, or when a content
73                       representing an IMAP message gets informed   by the IMAP
74                       server that the message has been deleted.</td></tr>
75    <tr><td>E3</td><td>The set of children of a folder content F is enlarged by
76                       some identifier A (that was not previously in that set,
77                       i.e., !(A in H1(F)) && (A in H2(F))), denoted as E3(F, A).
78                       For example, this event may occur when a new content
79                       created at folder F processes its "insert" command, or
80                       when a folder representing   an IMAP mailbox gets informed
81                       by the IMAP server that a new message has arrived at that
82                       mailbox.</td></tr>
83    </table>
84
85    <p>
86    Finally, the list of reactions taken by contents in response to the above
87    events gives a description of what kinds of ContentEvents are sent in which
88    situations:
89    </p>
90
91    <table border =1>
92    <tr><td>R1</td><td>E1(C: A->B) results in C sending an EXCHANGED
93                       ContentEvent, which then results in the following: All
94                       folders F that used to have A as a child, but will not
95                       have B as a child, i.e., (A in H1(F)) && !(B in H2(F)),
96                       send a REMOVED ContentEvent.</td></tr>
97    <tr><td>R2</td><td>E2(C) results in C sending a DELETED ContentEvent,
98                       which then results in the following:  All folders F that
99                       used to have A as a child, but will not continue to have
100                       A as a child, i.e., (A in H1(F)) && !(A in H2(F)), send
101                       a REMOVED event.</td></tr>
102    <tr><td>R3</td><td>E3(F, A) results in F sending an INSERTED event.</td></tr>
103    </table>
104*/
105published constants ContentAction
106{
107    //-------------------------------------------------------------------------
108    /** A content was inserted into a folder content (i.e., while updating the
109        folder).
110
111        <p>This action must be notified at the listeners of the folder content.
112    */
113    const long INSERTED = 0;
114
115    //-------------------------------------------------------------------------
116    /** A content was removed from a folder content, but not physically
117        destroyed (i.e., due to rules just applied to the folder).
118
119        <p>This action must be notified at the listeners of the folder content.
120    */
121    const long REMOVED = 1;
122
123    //-------------------------------------------------------------------------
124    /** A content was physically destroyed.
125
126        <p>Events containing this action may be generated at any time. So a
127        content event listener should be prepared to get notified the "death"
128        of the related content!
129
130        <p>This action must be notified at the listeners of the deleted
131        content.
132    */
133    const long DELETED = 2;
134
135    //-------------------------------------------------------------------------
136    /** This Action indicates that a content has changed its identity (i.e.
137        after renaming a file system folder).
138
139        <p>This action must be notified at the listeners of the exchanged
140        content.
141    */
142    const long EXCHANGED = 4;
143
144    //-------------------------------------------------------------------------
145    /** This is obsolete and should no longer be used.
146
147        @deprecated
148    */
149    const long SEARCH_MATCHED = 128;
150
151};
152
153//=============================================================================
154
155}; }; }; };
156
157#endif
158