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