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