ClientUserDelegate.h #1

  • //
  • guest/
  • robert_cowham/
  • perforce/
  • API/
  • P4.Net/
  • main/
  • src/
  • p4dn/
  • ClientUserDelegate.h
  • View
  • Commits
  • Open Download .zip Download (3 KB)
/*
 * P4.Net *
Copyright (c) 2007 Shawn Hladky

Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
and associated documentation files (the "Software"), to deal in the Software without 
restriction, including without limitation the rights to use, copy, modify, merge, publish, 
distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the 
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or 
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
 */


#pragma once
#include "StdAfx.h"
#include "Error_m.h"
#include "ClientUser_m.h"
#include <vcclr.h>

//================================================================
// wrapper for callbacks into into the ClienUser class
//
//
// Implements callbacks to interface the clientapi with the .NET interface
//================================================================
class ClientUserDelegate : public ::ClientUser 
{
	private:
		gcroot<p4dn::ClientUser^> mcu;
		gcroot<System::Text::Encoding^> _encoding;
	public:            
		ClientUserDelegate( gcroot<p4dn::ClientUser^> ManagedClientUser, gcroot<System::Text::Encoding^> encoding );
		~ClientUserDelegate();
		void InputData( StrBuf *strbuf, ::Error *e );
		void HandleError( ::Error *err );
		void Message( ::Error *err );
		void OutputError( const_char *errBuf );
		void OutputInfo( char level, const_char *data );
		void OutputBinary( const_char *data, int length );
		void OutputText( const_char *data, int length );
		void OutputStat( StrDict *varList );
		void Prompt( const StrPtr &msg, StrBuf &rsp, int noEcho, ::Error *e );
		void ErrorPause( char *errBuf, ::Error *e );
		void Edit( FileSys *f1, ::Error *e );
		void Diff( FileSys *f1, FileSys *f2, int doPage, char *diffFlags, ::Error *e );
		void Merge( FileSys *base, FileSys *leg1, FileSys *leg2, FileSys *result, ::Error *e );
		void Help( const_char *const *help );
		FileSys *File( FileSysType type );
		void Finished();
		int	Resolve( ClientMerge *m, Error *e );
};
# Change User Description Committed
#1 6414 Robert Cowham Initial branch
//guest/shawn_hladky/P4.Net/main/src/p4dn/ClientUserDelegate.h
#6 6387 Shawn Hladky P4.net: Upgrade to C++/CLI.
 Changes merged from Jim Gomes.
#5 6353 Shawn Hladky P4.Net:  Implemented diff functionality
Implemented Merge functionality
Converted print commands to the callback interface
#4 5902 Shawn Hladky P4.net.
 More unit tests and bug fixes
#3 5878 Shawn Hladky P4.Net:  1.0, support for raw spec processing.
 Update copyright.  Fix build script.  Bugs found along the way.
#2 5838 Shawn Hladky P4.Net: WIP support for unicode server
#1 5830 Shawn Hladky P4.Net: reorg to support release branches
//guest/shawn_hladky/P4.Net/src/p4dn/ClientUserDelegate.h
#3 5798 Shawn Hladky P4.Net...  still not ready for beta
Added license to all files
Added several doc files
Misc bugs
#2 5411 Shawn Hladky WIP -- forms are working now.
#1 5348 Shawn Hladky Re-organizing, for the improved API
//guest/shawn_hladky/PerforceDotNet/p4dn/ClientUserDelegate.h
#2 5064 Shawn Hladky WIP -- Added ability to parse forms.
Added new tester application.
** not ready for human consumption, needs more review and testing.
#1 4545 Shawn Hladky Several Fixes:
Updated solution to Visual Studio 2003
Implemented InputData
Implemented OutPutBinary
Changed ClientAPI and Error objects to implement the IDisposable interface to improve Garbage Collection
Changed header files so you don't need to add #pragma once to the p4 api headers.
Refactored the ClientUserDelagate class
Fixed a few minor memory leaks