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
24#ifndef __com_sun_star_script_vba_VBAEventId_idl__
25#define __com_sun_star_script_vba_VBAEventId_idl__
26
27//=============================================================================
28
29module com {  module sun {  module star { module script { module vba {
30
31//=============================================================================
32
33/** Constants used to identify VBA document events.
34
35    <p>If one of these events is fired, a specific VBA macro in a specific
36    document code module will be executed.</p>
37
38    <p>Each event expects some specific arguments to be passed to
39    <member>XVBAEventProcessor::processVbaEvent</member>.</p>
40
41    @see XVBAEventProcessor
42 */
43constants VBAEventId
44{
45    //=========================================================================
46
47    /** An identifier not corresponding to any VBA document event. */
48    const long NO_EVENT                             = -1;
49
50    //=========================================================================
51    // Global events (identifiers from 1 to 999)
52
53    /** New document opened from template. No arguments. */
54    const long AUTO_NEW                             = 1;
55    /** Document opened (loaded). No arguments. */
56    const long AUTO_OPEN                            = 2;
57    /** Document about to be closed. No arguments. */
58    const long AUTO_CLOSE                           = 3;
59    /** Application start. No arguments. */
60    const long AUTO_EXEC                            = 4;
61    /** Application exit. No arguments. */
62    const long AUTO_EXIT                            = 5;
63
64    //=========================================================================
65    // MS Word (identifiers from 1001 to 1999)
66
67    /** New text document opened from template. No arguments. */
68    const long DOCUMENT_NEW                         = 1001;
69    /** Text document opened (loaded). No arguments. */
70    const long DOCUMENT_OPEN                        = 1002;
71    /** Document about to be closed. No arguments. */
72    const long DOCUMENT_CLOSE                       = 1003;
73
74    //=========================================================================
75    // MS Excel (identifiers from 2001 to 2999)
76
77    //-------------------------------------------------------------------------
78    // document events (2001-2099)
79
80    /** Document activated. No arguments. */
81    const long WORKBOOK_ACTIVATE                    = 2001;
82    /** Document deactivated. No arguments. */
83    const long WORKBOOK_DEACTIVATE                  = 2002;
84    /** Document opened (loaded). No arguments. */
85    const long WORKBOOK_OPEN                        = 2003;
86    /** Document about to be closed. Arguments: [out] boolean bCancel. */
87    const long WORKBOOK_BEFORECLOSE                 = 2004;
88    /** Document about to be printed. Arguments: [out] boolean bCancel. */
89    const long WORKBOOK_BEFOREPRINT                 = 2005;
90    /** Document about to be saved. Arguments: boolean bSaveAs, [out] boolean bCancel. */
91    const long WORKBOOK_BEFORESAVE                  = 2006;
92    /** Document has been saved. Arguments: boolean bSuccess. */
93    const long WORKBOOK_AFTERSAVE                   = 2007;
94    /** New sheet inserted. Arguments: short nSheet. */
95    const long WORKBOOK_NEWSHEET                    = 2008;
96    /** Document window has been activated. Arguments: XController aController. */
97    const long WORKBOOK_WINDOWACTIVATE              = 2009;
98    /** Document window has been deactivated. Arguments: XController aController. */
99    const long WORKBOOK_WINDOWDEACTIVATE            = 2010;
100    /** Document window has been resized. Arguments: XController aController. */
101    const long WORKBOOK_WINDOWRESIZE                = 2011;
102
103    //-------------------------------------------------------------------------
104    // sheet events (2101-2199)
105
106    /** Worksheet has been activated (made visible). Arguments: short nSheet. */
107    const long WORKSHEET_ACTIVATE                   = 2101;
108    /** Worksheet has been activated (made visible). Arguments: short nSheet. */
109    const long WORKSHEET_DEACTIVATE                 = 2102;
110    /** Double click in the sheet. Arguments: XRange/XSheetCellRangeContainer aRange, [out] boolean bCancel. */
111    const long WORKSHEET_BEFOREDOUBLECLICK          = 2103;
112    /** Right click in the sheet. Arguments: XRange/XSheetCellRangeContainer aRange, [out] boolean bCancel. */
113    const long WORKSHEET_BEFORERIGHTCLICK           = 2104;
114    /** Cells in sheet have been recalculated. Arguments: short nSheet. */
115    const long WORKSHEET_CALCULATE                  = 2105;
116    /** Cells in sheet have been changed. Arguments: XRange/XSheetCellRangeContainer aRange. */
117    const long WORKSHEET_CHANGE                     = 2106;
118    /** Selection in sheet has been changed. Arguments: XRange/XSheetCellRangeContainer aRange. */
119    const long WORKSHEET_SELECTIONCHANGE            = 2107;
120    /** Hyperlink has been clicked. Arguments: XCell aCell. */
121    const long WORKSHEET_FOLLOWHYPERLINK            = 2108;
122
123    //=========================================================================
124
125    /** Implementations are allowed to use identifiers above this value for any
126        internal purpose. */
127    const long USERDEFINED_START                    = 1000000;
128};
129
130//=============================================================================
131
132}; }; }; }; };
133
134//=============================================================================
135
136#endif
137