/src/mozilla-central/toolkit/components/commandlines/nsCommandLine.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
2 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | | |
5 | | #ifndef nsCommandLine_h |
6 | | #define nsCommandLine_h |
7 | | |
8 | | #include "nsICommandLineRunner.h" |
9 | | #include "nsCOMPtr.h" |
10 | | #include "nsISupportsImpl.h" |
11 | | #include "nsTArray.h" |
12 | | |
13 | | class nsICommandLineHandler; |
14 | | class nsICommandLineValidator; |
15 | | class nsIDOMWindow; |
16 | | class nsIFile; |
17 | | |
18 | | class nsCommandLine final : public nsICommandLineRunner |
19 | | { |
20 | | public: |
21 | | NS_DECL_ISUPPORTS |
22 | | NS_DECL_NSICOMMANDLINE |
23 | | NS_DECL_NSICOMMANDLINERUNNER |
24 | | |
25 | | nsCommandLine(); |
26 | | |
27 | | protected: |
28 | 0 | ~nsCommandLine() = default; |
29 | | |
30 | | typedef nsresult (*EnumerateHandlersCallback)(nsICommandLineHandler* aHandler, |
31 | | nsICommandLine* aThis, |
32 | | void *aClosure); |
33 | | typedef nsresult (*EnumerateValidatorsCallback)(nsICommandLineValidator* aValidator, |
34 | | nsICommandLine* aThis, |
35 | | void *aClosure); |
36 | | |
37 | | void appendArg(const char* arg); |
38 | | MOZ_MUST_USE nsresult resolveShortcutURL(nsIFile* aFile, nsACString& outURL); |
39 | | nsresult EnumerateHandlers(EnumerateHandlersCallback aCallback, void *aClosure); |
40 | | nsresult EnumerateValidators(EnumerateValidatorsCallback aCallback, void *aClosure); |
41 | | |
42 | | nsTArray<nsString> mArgs; |
43 | | uint32_t mState; |
44 | | nsCOMPtr<nsIFile> mWorkingDir; |
45 | | nsCOMPtr<nsIDOMWindow> mWindowContext; |
46 | | bool mPreventDefault; |
47 | | }; |
48 | | |
49 | | #endif |
50 | | |