crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/Plugin/CAPluginCrashAnalysis.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 using System.Threading;
       
    18 using SymbianUtils;
       
    19 using CrashAnalyserEngine.Engine;
       
    20 using CrashAnalyserEngine.Plugins;
       
    21 using CrashItemLib.Engine;
       
    22 using CrashItemLib.Engine.Interfaces;
       
    23 using CAPCrashAnalysis.CommandLine;
       
    24 
       
    25 namespace CAPCrashAnalysis.Plugin
       
    26 {
       
    27 	public class CAPluginCrashAnalysis : CAPlugin, ICIEngineUI
       
    28 	{
       
    29 		#region Constructors
       
    30         public CAPluginCrashAnalysis( CAEngine aEngine )
       
    31             : base( aEngine, KPluginName )
       
    32 		{
       
    33             iCommandLineEngine = new CACmdLineEngine( this );
       
    34             iCrashItemEngine = new CIEngine( aEngine.DebugEngine, this );
       
    35 		}
       
    36 		#endregion
       
    37 
       
    38         #region Constants
       
    39         public const string KPluginName = "Crash File Analysis";
       
    40         #endregion
       
    41 
       
    42 		#region API
       
    43         public string GetSupportedCrashFileTypes()
       
    44         {
       
    45             return CrashItemEngine.PluginRegistry.GetSupportedCrashFileTypes();
       
    46         }
       
    47 
       
    48         public void PrimeSources( string[] aFileNames )
       
    49         {
       
    50             // Seed up the crash item engine with all our file names
       
    51             CrashItemEngine.ClearAll();
       
    52             foreach ( string file in aFileNames )
       
    53             {
       
    54                 CrashItemEngine.Prime( new System.IO.FileInfo( file ) );
       
    55             }
       
    56         }
       
    57 
       
    58         public void IdentifyCrashes( TSynchronicity aSynchronicity )
       
    59         {
       
    60             CrashItemEngine.IdentifyCrashes( aSynchronicity );
       
    61         }
       
    62         #endregion
       
    63 
       
    64         #region From CAPlugin
       
    65         public override bool IsCommandLineHandler( string aName )
       
    66         {
       
    67             bool ret = iCommandLineEngine.IsCommandLineHandler( aName );
       
    68             return ret;
       
    69         }
       
    70 
       
    71         public override int RunCommandLineOperations()
       
    72         {
       
    73             int error = iCommandLineEngine.RunCommandLineOperations();
       
    74             return error;
       
    75         }
       
    76 
       
    77         public override CAPlugin.TType Type
       
    78         {
       
    79             get { return CAPlugin.TType.ETypeEngine; }
       
    80         }
       
    81         #endregion
       
    82 
       
    83 		#region Properties
       
    84         public CIEngine CrashItemEngine
       
    85         {
       
    86             get { return iCrashItemEngine; }
       
    87         }
       
    88 		#endregion
       
    89 
       
    90         #region Event handlers
       
    91         #endregion
       
    92 
       
    93         #region Internal methods
       
    94         #endregion
       
    95 
       
    96         #region From ICIEngineUI
       
    97         void ICIEngineUI.CITrace( string aMessage )
       
    98         {
       
    99             base.UIEngine.UIManager.UITrace( aMessage );
       
   100         }
       
   101 
       
   102         void ICIEngineUI.CITrace( string aFormat, params object[] aParameters )
       
   103         {
       
   104             base.UIEngine.UIManager.UITrace( aFormat, aParameters );
       
   105         }
       
   106         #endregion
       
   107 
       
   108         #region Operators
       
   109         public static implicit operator CIEngine( CAPluginCrashAnalysis aCrashFileEngine )
       
   110         {
       
   111             return aCrashFileEngine.CrashItemEngine;
       
   112         }
       
   113         #endregion
       
   114 
       
   115         #region Data members
       
   116         private readonly CIEngine iCrashItemEngine;
       
   117         private readonly CACmdLineEngine iCommandLineEngine;
       
   118         #endregion
       
   119     }
       
   120 }