toolkit/crashreporter/client/crashreporter_osx.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef CRASHREPORTER_OSX_H__
     7 #define CRASHREPORTER_OSX_H__
     9 #include <Cocoa/Cocoa.h>
    10 #include "HTTPMultipartUpload.h"
    11 #include "crashreporter.h"
    13 // Defined below
    14 @class TextViewWithPlaceHolder;
    16 @interface CrashReporterUI : NSObject
    17 {
    18     IBOutlet NSWindow* mWindow;
    20     /* Crash reporter view */
    21     IBOutlet NSTextField* mHeaderLabel;
    22     IBOutlet NSTextField* mDescriptionLabel;
    23     IBOutlet NSButton* mViewReportButton;
    24     IBOutlet NSScrollView* mCommentScrollView;
    25     IBOutlet TextViewWithPlaceHolder* mCommentText;
    26     IBOutlet NSButton* mSubmitReportButton;
    27     IBOutlet NSButton* mIncludeURLButton;
    28     IBOutlet NSButton* mEmailMeButton;
    29     IBOutlet NSTextField* mEmailText;
    30     IBOutlet NSButton* mCloseButton;
    31     IBOutlet NSButton* mRestartButton;
    32     IBOutlet NSProgressIndicator* mProgressIndicator;
    33     IBOutlet NSTextField* mProgressText;
    35     /* Error view */
    36     IBOutlet NSView* mErrorView;
    37     IBOutlet NSTextField* mErrorHeaderLabel;
    38     IBOutlet NSTextField* mErrorLabel;
    39     IBOutlet NSButton* mErrorCloseButton;
    41     /* For "show info" alert */
    42     IBOutlet NSWindow* mViewReportWindow;
    43     IBOutlet NSTextView* mViewReportTextView;
    44     IBOutlet NSButton* mViewReportOkButton;
    46     HTTPMultipartUpload* mPost;
    47 }
    49 - (void)showCrashUI:(const std::string&)dumpfile
    50     queryParameters:(const StringTable&)queryParameters
    51             sendURL:(const std::string&)sendURL;
    52 - (void)showErrorUI:(const std::string&)dumpfile;
    53 - (void)showReportInfo;
    54 - (void)maybeSubmitReport;
    55 - (void)closeMeDown:(id)unused;
    57 - (IBAction)submitReportClicked:(id)sender;
    58 - (IBAction)viewReportClicked:(id)sender;
    59 - (IBAction)viewReportOkClicked:(id)sender;
    60 - (IBAction)closeClicked:(id)sender;
    61 - (IBAction)restartClicked:(id)sender;
    62 - (IBAction)includeURLClicked:(id)sender;
    63 - (IBAction)emailMeClicked:(id)sender;
    65 - (void)controlTextDidChange:(NSNotification *)note;
    66 - (void)textDidChange:(NSNotification *)aNotification;
    67 - (BOOL)textView:(NSTextView *)aTextView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString;
    69 - (void)doInitialResizing;
    70 - (float)setStringFitVertically:(NSControl*)control
    71                          string:(NSString*)str
    72                    resizeWindow:(BOOL)resizeWindow;
    73 - (void)setView:(NSView*)v animate: (BOOL) animate;
    74 - (void)enableControls:(BOOL)enabled;
    75 - (void)updateSubmit;
    76 - (void)updateURL;
    77 - (void)updateEmail;
    78 - (void)sendReport;
    79 - (bool)setupPost;
    80 - (void)uploadThread:(HTTPMultipartUpload*)post;
    81 - (void)uploadComplete:(NSData*)data;
    83 -(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication;
    84 -(void)applicationWillTerminate:(NSNotification *)aNotification;
    86 @end
    88 /*
    89  * Subclass NSTextView to provide a text view with placeholder text.
    90  * Also provide a setEnabled implementation.
    91  */
    92 @interface TextViewWithPlaceHolder : NSTextView {
    93   NSMutableAttributedString *mPlaceHolderString;
    94 }
    96 - (BOOL)becomeFirstResponder;
    97 - (void)drawRect:(NSRect)rect;
    98 - (BOOL)resignFirstResponder;  
    99 - (void)setPlaceholder:(NSString*)placeholder;
   100 - (void)insertTab:(id)sender;
   101 - (void)insertBacktab:(id)sender;
   102 - (void)setEnabled:(BOOL)enabled;
   103 - (void)dealloc;
   105 @end
   107 #endif

mercurial