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